A flickering effect was introduced in commit 6c20307 for all popups. This is a consequence of a double redraw of the overlapping background characters. This could be expected for transparent popups, but, it should exclude opaque ones. For a complete fix of the flickering this commit is required in combination with fix present in 97c5bed.
Sourcing this simple script with background text (this can be the script itself) reproduces the issue:
" scroll_popup.vim " Continuously scrolling popup with multi-line content let s:text = [] for i in range(1, 50) call add(s:text, printf("This is scrolling line %02d — Vim popup demo", i)) endfor let s:firstline = 1 let s:popup_id = -1 function! s:scroll_popup(timer) abort let s:firstline += 1 " Wrap when reaching the end if s:firstline > len(s:text) let s:firstline = 1 endif call popup_setoptions(s:popup_id, {'firstline': s:firstline}) call popup_move(s:popup_id, { 'pos': 'botleft', 'line': s:firstline, 'col': 10 }) endfunction function! StartScrollingPopup() abort let s:popup_id = popup_create(s:text, { \ 'title': 'Scrolling Popup', \ 'pos': 'botleft', \ 'minwidth': 60, \ 'minheight': 10, \ 'maxheight': 10, \ 'border': [], \ 'scrollbar': 1, \ 'opacity': 100, \ }) call timer_start(1000, function('s:scroll_popup'), {'repeat': -1}) endfunction call StartScrollingPopup()
This is a video of the issue being triggered:
https://github.com/user-attachments/assets/21641b00-4604-4e8f-afe1-43caad7e2044
And this is a video with the fix applied:
https://github.com/user-attachments/assets/1a16ff76-7045-433c-83a9-b85f5d111114
Maybe this is a question for the mailing list, in this case I would ask in that channel. I would like to know which was the rationale behind the transparency feature, right now it looks like popup rendering with transparencies must end in flickering, since the background and frontend double drawing will force it. Is this a known limitation that will be addressed or it's a side effect that was unexpected when the feature was introduced?
https://github.com/vim/vim/pull/19534
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Please try #19536
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Hi @mattn, I have tried your branch and it doesn't address the issue. Maybe I'm missing something, but to me it's clear that those changes can't fix the issue.
The issue is motivated by a double redrawn, as long as the double redraw takes place, a flicker might be seem. Unless this double redrawn is prevented, and the final character is drawn only once, this issue will continue to take place, for opaque or transparent popups (right now for both). This is why I have posted questions in the first comment on this PR, in case I was missing something, if I need to post those questions in the mailing list, please let me know! Thanks.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
This PR fixes flickering for me:
Before:
After:
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
There are a few compile errors. Can you please fix those? I am also not sure, why so many tests fail, so let's hope those were flaky
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()