fix: skip full-screen clear in fullscreen mode to prevent flicker#192
Closed
fuleinist wants to merge 1 commit into
Closed
fix: skip full-screen clear in fullscreen mode to prevent flicker#192fuleinist wants to merge 1 commit into
fuleinist wants to merge 1 commit into
Conversation
In fullscreen mode, write_canvas() already overwrites every row and emits CSI K (erase to end of line) for each row. The full clear was redundant and caused visible flicker on rapid state changes with dense per-cell styling. This matches the approach described in PR ccbrown#190 from djordjeglbvc. Fixes: ccbrown#190
Owner
|
#179 resolves this. Thanks anyway! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using
element.fullscreen(), rapid state changes which fire TUI updates cause visible flicker at the bottom of the terminal. The flicker ranges from a few rows to more than half the screen, and always affects the bottom portion. The issue is apparent in applications with dense per-cell styling (background colors, multiple text styles per row) and complex web of UI components/elements.Observed on Konsole 25.04.2 (Wayland). The terminal supports DEC mode 2026 (synchronized output), but the flicker occurs regardless — the volume of ANSI data between clear and rewrite appears to exceed what synchronized output can atomically batch.
Since
write_canvas()overwrites every row and each row already emits CSI K (erase to end of line), the full-screen clear is redundant. This fix adds an explicit early-return path for fullscreen mode that only repositions the cursor to (0,0), skipping bothclear_canvas_inlineand the full terminal clear.The non-fullscreen (inline) path is unchanged — it still needs the clear to handle variable-height output correctly.
Fixes #190