tuigreet icon indicating copy to clipboard operation
tuigreet copied to clipboard

Screen flickering

Open bound-variable opened this issue 3 years ago • 7 comments

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 avatar Aug 01 '22 05:08 bound-variable

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.

bound-variable avatar Aug 09 '22 22:08 bound-variable

https://user-images.githubusercontent.com/14130581/206814859-c4a893a7-8553-456c-83ad-043e6ae33b96.mp4

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

Arch greetd: 0.8.0-1 tuigreet: 0.8.0-0

JohnOberhauser avatar Dec 10 '22 00:12 JohnOberhauser

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.

schmidicom avatar Jul 11 '23 10:07 schmidicom

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 avatar Oct 14 '23 21:10 apognu

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 avatar Oct 15 '23 16:10 apognu

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 avatar Oct 21 '23 14:10 apognu

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.

apognu avatar Nov 04 '23 18:11 apognu