GithubHelp home page GithubHelp logo

Flickering of menu (?) about tuifimanager HOT 27 OPEN

giorgosxou avatar giorgosxou commented on May 17, 2024
Flickering of menu (?)

from tuifimanager.

Comments (27)

GiorgosXou avatar GiorgosXou commented on May 17, 2024

THAT"S SO WIERD

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

Ha... there's might be a need of reinitialization (BEGIN...END_MOUSE) when a new pad (like the menu) is created

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

I think it has to do with the ncurses itself, thinking that the mouse escape sequences are part of a change to the stdscr, forcing it to redraw itself again and again (?)

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

I need to make a minimal reproducible example before I post the issue and i don't know if I have the time to do so... but I have to do so...

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

... forcing it to redraw itself again and again (?)

But if this is true, then why it gets fixed the momment I END_MOUSE > suspend the app > open a subprocess > wait until it closes > BEGIN_MOUSE ???

def __try_open_file_with(self, directory: str, open_with: Optional[str]) -> None:

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

May the lord of ncurses Thomas E. Dickey , saves me 🙏

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

(or anyone else lol)

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

Ok ok... I'll try to make a minimal reproducible example in c\c++ when i find the time (or I'll ask GPT-chat to do so, for me xD )

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

WTF somehow without changing anything in the source code, now it doesn't flicker... the last thing I remember doing was just to xset r rate 250 30 and play around with kbdrate which I don't think that they have any anything to do with the issue itself... something more wierd is happening and I can't figure it out

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

The Issue is completly random, I can't pinpoint when it is happening besides that when it is happening, it gets solved by doing what i've said in the first comment

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

Sometimes it just works without flickering and some times it doesn't

image

from tuifimanager.

Sigmanificient avatar Sigmanificient commented on May 17, 2024

I guess we could have some kind of drawing pipeline, where the context menu would be drawn on top, such that other items below it would be partially drawn, to only have 1 update per char location?

from tuifimanager.

Sigmanificient avatar Sigmanificient commented on May 17, 2024
from dataclasses import dataclass
from typing import List


@dataclass
class Rect:
    x: int
    y: int
    width: int
    height: int


@dataclass
class Drawable:
    rect: Rect
    z_index: int
    content: List[str]
    # instead of having a single string with line feeds, 
    # a list containing each line for easier manipulation.

    def render(self, screen, ...):
        # Compute whether this intersect with other element,
        # Draw the strings to make sure it doesn't replace character
        # And don't overdraw a other item with an higher z_index
        ...

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

Intersections and redrawing is something that ncurses handles by itself during refresh (really efficiently actually), it's not that much of our business to handle them. Also even if we wanted, this issue kinda prevents as at the momment

Rect and Drawable are somewhat equivalent to the ncurses-WINDOW\pad [...] This issue apears from nowhere and I don't really know what is causing it really, besides that when it (randomly) appears on startup it gets solved the momment I do what i've said at the first comment

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

Do you expirience the same issue too? (just to make sure)

from tuifimanager.

Sigmanificient avatar Sigmanificient commented on May 17, 2024

Oh well i didn't know that

from tuifimanager.

Sigmanificient avatar Sigmanificient commented on May 17, 2024

Do you expirience the same issue too? (just to make sure)

I need to check

from tuifimanager.

Sigmanificient avatar Sigmanificient commented on May 17, 2024

Do you expirience the same issue too?
It doesn't seem to flicker, but it something isn't properly rendered

image
image

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

could you post a full terminal screenshot, because this seems to be that you just have a really small sized window

from tuifimanager.

Sigmanificient avatar Sigmanificient commented on May 17, 2024

I guess having a rendering pipeline (without checking for collision) could be a good idea, so that everything is indexed properly, and the ui part is extracted

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

on those images you posted is you terminal smaller than 20 rows?

from tuifimanager.

Sigmanificient avatar Sigmanificient commented on May 17, 2024

Base size:
image

Bigger:
image

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

This is another issue, it is related to the fact that when you right click, the terminal is too small to either open the menu on top or at the bottom of the position where you clicked, and such it crops it

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

maybe a smaller menu might be great

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

if you click on one of the upper icons or expand\unzoom the terminal even more this issue disapears, this is just a bad implementation i did, it is easilly improvable, the real issue is with the flickering though

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

Here's the bad implementation of the positioning of the menu :P

if self.y + self.height > parent_height: self.y -= self.height

from tuifimanager.

GiorgosXou avatar GiorgosXou commented on May 17, 2024

Here you go, now it's better hehe

73f0d4c

from tuifimanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.