[vim/vim] GTK4: fix shell resize and font-change redraw (PR #20317)

1 view
Skip to first unread message

mattn

unread,
May 24, 2026, 10:59:06 AM (15 hours ago) May 24
to vim/vim, Subscribed

GTK4 builds did not honor set lines=... / set columns=... after the window was realized, and font changes left the editor blank until forced refresh.

Two related issues in src/gui_gtk4.c:

  1. gui_mch_set_shellsize() only called gtk_window_set_default_size(). In GTK4 that mostly affects the initial show; once realized, window managers such as xfwm4 on X11 ignore further updates because gui.drawarea has no natural size to drive a grow. Push the requested size with a temporary gtk_widget_set_size_request() on the drawing area, then clear it on idle so the user can still shrink the window manually.

  2. After the drawing area is resized, drawarea_resize_cb() destroys and recreates the backing cairo surface filled with the background color. The follow-up gui_resize_shell() skips shell_resized() when Rows/Columns are unchanged (typical for font changes that keep the same cell count), so the fresh surface stayed blank. Set gui.force_redraw before calling gui_resize_shell() to guarantee a full redraw.

Fixes #20307


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

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

Commit Summary

  • 2137781 GTK4: shell resize and font change leave the window blank or wrong size

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20317@github.com>

Reply all
Reply to author
Forward
0 new messages