Skip to content

Repaint only when the selection changes - #273

Open
eXpl0it3r wants to merge 1 commit into
masterfrom
fix/pre-selection-flicker
Open

eXpl0it3r wants to merge 1 commit into
masterfrom
fix/pre-selection-flicker

Conversation

@eXpl0it3r

@eXpl0it3r eXpl0it3r commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

While dragging a selection, every mouse move repainted the whole control, even when the selection didn't change at all, which is the case for most moves within the same character. SelectionHandler now only invalidates when the selection start or end word, or the character index within them, changed.

This doesn't explain the flicker in #271 on its own, the video shows half-painted frames, which points to the control painting without its back buffer. But fewer full repaints means a lot less traffic and flicker over remote desktop, especially for <pre> content, where every preserved space is its own word to draw.

See #271

How to test this PR?

CI should succeed. SelectionInvalidateIntegrationTests checks the repaint count and fails on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant