[vim/vim] GTK4: screen is cleared when moving the mouse after startup (PR #21021)

3 views
Skip to first unread message

h_east

unread,
Aug 11, 2026, 9:12:26 PM (2 days ago) Aug 11
to vim/vim, Subscribed
Problem:  In GTK4, moving the mouse over the window right after startup
          clears the screen, including the intro message.
Solution: Keep the cached contents of the drawing area in sync with the
          size Vim is going to draw.

fixes: #21016


gui.num_rows and gui.num_cols are set in two places at runtime, but only
gui_resize_shell() passes the new size on to the drawing area,
gui_set_shellsize() does not.

At startup the window is first allocated without the client side decorations,
so the row cache of the drawing area is created for 22 rows.
gui_set_shellsize() then raises gui.num_rows to 24 without resizing that
cache. When the window later gets its full size, gui_resize_shell() recreates
the cache for 24 rows and throws away everything in it. shell_resized() is
skipped there, because gui.num_rows, Rows, Columns and screen_Rows /
screen_Columns already agree, so nothing is redrawn and the next frame shows
an empty screen. Moving the mouse is only what makes GTK render that frame.

Syncing the drawing area in gui_set_shellsize() as well makes the cache 24
rows before anything is drawn, so nothing is lost and it is not recreated later.

Verified with vim --clean -g +h and vim --clean -g +"se ls=2", and with
:set lines=40 / :set columns=100 at runtime.

Not fixed here: the window still opens two rows short and grows when it first
receives a pointer event. That is the two step sizing added in 9.2.0931 and
needs a separate change.


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

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

Commit Summary

  • 5b55162 GTK4: screen is cleared when moving the mouse after startup

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21021@github.com>

Christian Brabandt

unread,
Aug 12, 2026, 3:06:02 PM (23 hours ago) Aug 12
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#21021)

thanks


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

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

h_east

unread,
11:03 AM (3 hours ago) 11:03 AM
to vim/vim, Subscribed
h-east left a comment (vim/vim#21021)

@64-bitman
Could you share your thoughts on the second half of the PR description? Do you plan to keep the current implementation, or are you planning to make changes?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

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

Foxe Chen

unread,
12:08 PM (2 hours ago) 12:08 PM
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#21021)

@64-bitman

Could you share your thoughts on the second half of the PR description? Do you plan to keep the current implementation, or are you planning to make changes?

Well considering its a bug, I suppose some changes should be made.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

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

h_east

unread,
12:40 PM (2 hours ago) 12:40 PM
to vim/vim, Subscribed
h-east left a comment (vim/vim#21021)

Understood. I will wait for you to make those updates.
Please feel free to reach out if you require any assistance.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

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

Reply all
Reply to author
Forward
0 new messages