Fix popup window flickering on content-only updates#19559
Closed
mattn wants to merge 7 commits intovim:masterfrom
Closed
Fix popup window flickering on content-only updates#19559mattn wants to merge 7 commits intovim:masterfrom
mattn wants to merge 7 commits intovim:masterfrom
Conversation
Member
Author
Test is failing but I can judge whether the problem is depend on firstline or not. |
Also, `opacity: 100` (fully opaque) now clears the `POPF_OPACITY` flag so the popup behaves exactly like a normal popup without opacity. The transparency rendering path is only used for `opacity: 1-99`.
Member
Author
|
Also, |
During screen redraw, background window drawing would output characters to the terminal for cells covered by popup windows. When the output buffer flushed between background and popup drawing, the raw background briefly appeared before the popup was redrawn, causing visible flicker during mouse wheel scrolling. Fix this in two ways: 1. In the skip_for_popup block in screen_line(), only call screen_char() during popup drawing (screen_zindex > 0). During background drawing (screen_zindex == 0), update the screen buffer but suppress terminal output. Set redraw_this = FALSE to prevent redundant drawing. 2. For opacity popups (which skip popup_mask), add a separate popup_opacity_mask array that tracks cells under opacity popups. Check this mask in screen_char() and screen_char_2() to suppress terminal output during background drawing. This covers all output paths including screen_fill().
# Conflicts: # src/screen.c
- Always call popup_adjust_position() in popup_setoptions() so that border, close, padding changes are properly applied (restores original behavior). - Use lightweight redraw (w_redr_type) for content-only changes (firstline, highlights) to avoid flickering. - Remove popup_opacity_mask: master's patch v9.2.0104 already handles background suppression for opaque popups via screen_opacity_popup, and popup_opacity_mask was incorrectly blocking terminal output for transparent popup cells.
Member
Author
|
What this pull request fixes
See #19510 |
Member
|
thanks |
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
popup_setoptions()is called to update onlyfirstline(e.g. scrolling via a timer), windows behind the popup flicker because a full popup mask refresh andUPD_NOT_VALIDredraw are triggered every time, even though the popup's position and size haven't changed.This patch distinguishes content-only changes (
firstline, highlights) from structural ones (zindex,popup_flags,blend). For content-only changes, skip the mask refresh andpopup_adjust_position(), and useUPD_VALIDinstead ofUPD_NOT_VALIDso only the popup itself is redrawn.#19510 (comment)