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.Clear — Flickering on Windows #647

Closed
rivo opened this issue Nov 6, 2023 · 4 comments
Closed

Screen.Clear — Flickering on Windows #647

rivo opened this issue Nov 6, 2023 · 4 comments
Labels

Comments

@rivo
Copy link
Contributor

rivo commented Nov 6, 2023

Following up on this comment, I noticed that calling Screen.Clear() prior to Screen.Show() (and after drawing other elements) leads to full-screen flickering on Windows. It's as if the call to Clear() immediately clears the screen instead of deferring it to Show(). The comment above illustrates this with a video. Here is the relevant code in tview. If I remove the call to Clear(), there is no flickering anymore (but this has other unintended side effects, so I would like to keep Clear() there).

Is this the intended behaviour? If so, what's the best way to clear the screen buffer at the beginning of a drawing cycle?

@gdamore
Copy link
Owner

gdamore commented Dec 3, 2023

Ok, I just reviewed the code... the implementation of Clear() on current versions is literally Fill(). So there should be no flickering. Is it possible that you are using a version of Tcell that does not include a642547 (i.e. I think this report is probably a duplicate of #576 )

@gdamore
Copy link
Owner

gdamore commented Dec 3, 2023

So 576 only fixed POSIX. The fix is simple. Stay tuned.

@rivo
Copy link
Contributor Author

rivo commented Dec 6, 2023

Thanks, @gdamore! Looks like this solves the problem.

(As a minor note, it looks like the cursor still flickers on Windows even when the screen content remains the same and the cursor's position doesn't change. But I haven't looked into this in detail so I don't know if this is a tcell problem.)

@gdamore
Copy link
Owner

gdamore commented Dec 10, 2023

I suspect that we need to hide the cursor when drawing. In the past we drew using a direct API, but now that we're using the escape codes to do this, we probably need to add the logic to hide the cursor for a redraw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants