Skip to content
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

Screen flickering #71

Open
bound-variable opened this issue Aug 1, 2022 · 7 comments
Open

Screen flickering #71

bound-variable opened this issue Aug 1, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@bound-variable
Copy link

bound-variable commented Aug 1, 2022

The screen sometimes flicker. It seems to do so randomly, not immediately before or after pressing any keys.

Greetd: 0.8.0-1
tuigreet: 0.7.3
Arch

My config.toml:

[terminal]
vt = 1

[default_session]
command = "tuigreet"
user = "greeter"

I don't know how else to get other relevant information for you.

@bound-variable
Copy link
Author

The only flickering I've been experiencing recently is the underscore cursor, which blinks a few times after the screen goes blank upon entering my password and pressing enter.

@JohnOberhauser
Copy link

JohnOberhauser commented Dec 10, 2022

cursor.mp4

I'm also getting the underscore cursor blink. Happens constantly for me

Arch
greetd: 0.8.0-1
tuigreet: 0.8.0-0

@schmidicom
Copy link

The cursor does not blink regularly for me either.
https://drive.google.com/file/d/1yknWCrRX9qRjHRhLIVaEoD8jhLlp0CH0/view?usp=sharing

I only noticed this after I switched my Gentoo to a tickless kernel.
https://en.wikipedia.org/wiki/Tickless_kernel
And in the Gentoo forum there was a suggestion that this behavior might come from crossterm.

@apognu
Copy link
Owner

apognu commented Oct 14, 2023

Yes I have noticed that as well, and it is either my fault, and the way I handle events and screen refreshes, or is an issue with crossterm. I will try looking into it, but I do not have a definitive idea on how I could fix this, yet.

@apognu
Copy link
Owner

apognu commented Oct 15, 2023

If we consider this being an upstream issue, I see two workarounds on tuigreet's side:

  • Ask crossterm to use steady cursor instead of blinking. I tried but couldn't make it work, I need to see if this is supported on Linux ttys.
  • Try rendering at a more or less steady pace instead of "as soon as possible" as it is now. It will not prevent flickering, but might make it more bearable because at least the flicker should be somewhat more consistent.

None of those is a magic bullet to the issue, though.

@apognu apognu self-assigned this Oct 15, 2023
@apognu apognu added the bug Something isn't working label Oct 15, 2023
@apognu
Copy link
Owner

apognu commented Oct 21, 2023

I added a rate limiter to the screen refresh (not yet on master), so while it does not solve this issue, I hope it makes less of an eye sore.

@apognu
Copy link
Owner

apognu commented Nov 4, 2023

Well, this did not go as expected, I had to revert some of this. But yeah, it seems that the cursor is being reset in its blinking cycle whenever I set its position. Unfortunately, ratatui requires a position to be set at each render (otherwise, it hides it), so it is a bit of a catch-22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants