[vim/vim] Fix popup window flickering on content-only updates (PR #19559)

11 views
Skip to first unread message

mattn

unread,
Mar 3, 2026, 12:22:22 AM (4 days ago) Mar 3
to vim/vim, Subscribed

When popup_setoptions() is called to update only firstline (e.g. scrolling via a timer), windows behind the popup flicker because a full popup mask refresh and UPD_NOT_VALID redraw 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 and popup_adjust_position(), and use UPD_VALID instead of UPD_NOT_VALID so only the popup itself is redrawn.

" Reproducer
let s:id = popup_create(range(1, 50)->map({i, v -> $"line {v}"}), {
  \ 'pos': 'center', 'minwidth': 60, 'maxheight': 10, 'border': [],
  \ })
let s:n = 1
function! s:scroll(timer) abort
  let s:n = s:n % 50 + 1
  call popup_setoptions(s:id, {'firstline': s:n})
endfunction
call timer_start(500, function('s:scroll'), {'repeat': -1})

#19510 (comment)


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/19559

Commit Summary

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19559@github.com>

mattn

unread,
Mar 3, 2026, 12:37:15 AM (4 days ago) Mar 3
to vim/vim, Subscribed
mattn left a comment (vim/vim#19559)
	Found errors in Test_popup_firstline():
	command line..script /home/runner/work/vim/vim/src/testdir/runtest.vim[636]..function RunTheTest[63]..Test_popup_firstline line 30: Expected 11 but got 10
	command line..script /home/runner/work/vim/vim/src/testdir/runtest.vim[636]..function RunTheTest[63]..Test_popup_firstline line 36: Expected 10 but got 9
	command line..script /home/runner/work/vim/vim/src/testdir/runtest.vim[636]..function RunTheTest[63]..Test_popup_firstline line 41: Expected 10 but got 9

Test is failing but I can judge whether the problem is depend on firstline or not.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19559/c3988772973@github.com>

mattn

unread,
Mar 3, 2026, 12:42:22 AM (4 days ago) Mar 3
to vim/vim, Push

@mattn pushed 1 commit.

  • b9f45eb clear POPF_OPACITY if opacity is 100


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19559/before/77766d7d66bf49dc9c4dbdd1b940a1fa7b5b37ba/after/b9f45eb106558aa0cea28db18611b36f49b7e2e1@github.com>

mattn

unread,
Mar 3, 2026, 12:42:47 AM (4 days ago) Mar 3
to vim/vim, Subscribed
mattn left a comment (vim/vim#19559)

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.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19559/c3988788472@github.com>

mattn

unread,
Mar 3, 2026, 8:47:50 AM (4 days ago) Mar 3
to vim/vim, Push

@mattn pushed 1 commit.

  • f8e96e3 window redraw on content-only updates

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19559/before/b9f45eb106558aa0cea28db18611b36f49b7e2e1/after/f8e96e32a65da2c553ae5dfc388c9a61025e83f6@github.com>

mattn

unread,
Mar 3, 2026, 10:26:14 AM (3 days ago) Mar 3
to vim/vim, Push

@mattn pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19559/before/f8e96e32a65da2c553ae5dfc388c9a61025e83f6/after/136cf6e829a8b2c10f1be4945d3b8e01d8f4ff4e@github.com>

mattn

unread,
Mar 3, 2026, 8:54:21 PM (3 days ago) Mar 3
to vim/vim, Push

@mattn pushed 1 commit.

  • 401045c suppress background terminal output under popup windows

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19559/before/136cf6e829a8b2c10f1be4945d3b8e01d8f4ff4e/after/401045ca94508f7420b59718a107b4501a2a82c0@github.com>

mattn

unread,
Mar 3, 2026, 9:11:35 PM (3 days ago) Mar 3
to vim/vim, Push

@mattn pushed 1 commit.

  • 46f5f39 Merge remote-tracking branch 'origin/master' into fix-popup-flicker

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19559/before/401045ca94508f7420b59718a107b4501a2a82c0/after/46f5f39130056f3854c8d6a0dffecd60feca1206@github.com>

mattn

unread,
Mar 3, 2026, 10:19:44 PM (3 days ago) Mar 3
to vim/vim, Push

@mattn pushed 1 commit.

  • 5f00505 fix popup_setoptions regression and remove popup_opacity_mask

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19559/before/46f5f39130056f3854c8d6a0dffecd60feca1206/after/5f00505191000018f5b52c5eb8e2af5f08a06cee@github.com>

mattn

unread,
Mar 3, 2026, 10:32:33 PM (3 days ago) Mar 3
to vim/vim, Subscribed
mattn left a comment (vim/vim#19559)

What this pull request fixes

  • Reduces the redraw area when changes are confined to the popup window
  • Prevents flickering of the popup window during background scrolling

See #19510


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19559/c3995025177@github.com>

Christian Brabandt

unread,
Mar 5, 2026, 3:40:44 PM (yesterday) Mar 5
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19559)

thanks


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19559/c4007645118@github.com>

Christian Brabandt

unread,
Mar 5, 2026, 3:40:45 PM (yesterday) Mar 5
to vim/vim, Subscribed

Closed #19559 via 4d0c57e.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19559/issue_event/23311069358@github.com>

Reply all
Reply to author
Forward
0 new messages