-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flickering of menu (?) #62
Comments
THAT"S SO WIERD |
Ha... there's might be a need of reinitialization (BEGIN...END_MOUSE) when a new pad (like the menu) is created |
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 (?) |
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... |
But if this is true, then why it gets fixed the momment I TUIFIManager/TUIFIManager/__init__.py Line 251 in dcc17d8
|
May the lord of ncurses Thomas E. Dickey , saves me 🙏 |
(or anyone else lol) |
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 ) |
WTF somehow without changing anything in the source code, now it doesn't flicker... the last thing I remember doing was just to |
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 |
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 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
... |
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
|
Do you expirience the same issue too? (just to make sure) |
Oh well i didn't know that |
I need to check |
could you post a full terminal screenshot, because this seems to be that you just have a really small sized window |
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 |
on those images you posted is you terminal smaller than 20 rows? |
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 |
maybe a smaller menu might be great |
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 |
Here's the bad implementation of the positioning of the menu :P TUIFIManager/TUIFIManager/TUIMenu.py Line 54 in 5b45e00
|
Here you go, now it's better hehe |
For some very wierd reason, the issue gets solved the momment I open a file to an external app (it doesn't matter if the external app is a TUI or not), I'm guessing this has to do with the
print(BEGIN_MOUSE)
in main\r vs \n vs \r\n etc.
The text was updated successfully, but these errors were encountered: