Commit: patch 9.2.0521: GTK4: cannot resize shell after the window is shown

6 views
Skip to first unread message

Christian Brabandt

unread,
May 23, 2026, 3:00:14 PMMay 23
to vim...@googlegroups.com
patch 9.2.0521: GTK4: cannot resize shell after the window is shown

Commit: https://github.com/vim/vim/commit/b34fa59abbd4f70b595ccab435446744443914d6
Author: Yasuhiro Matsumoto <matt...@gmail.com>
Date: Sat May 23 18:49:43 2026 +0000

patch 9.2.0521: GTK4: cannot resize shell after the window is shown

Problem: GTK4: cannot resize shell after the window is shown
(Maxim Kim, after v9.2.0501)
Solution: Always apply the requested size with
gtk_window_set_default_size(), regardless of realized state
(Yasuhiro Matsumoto).

fixes: #20264
closes: #20269

Co-Authored-by: Claude <nor...@anthropic.com>
Signed-off-by: Yasuhiro Matsumoto <matt...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/gui_gtk4.c b/src/gui_gtk4.c
index 4b02fe1a7..a9c9de7ca 100644
--- a/src/gui_gtk4.c
+++ b/src/gui_gtk4.c
@@ -772,15 +772,9 @@ gui_mch_set_shellsize(int width, int height,
int base_width UNUSED, int base_height UNUSED,
int direction UNUSED)
{
- // Only set window size if it hasn't been shown yet (initial sizing).
- // After that, the window size is controlled by the user/WM and
- // Vim adapts to it via form_size_allocate -> gui_resize_shell.
- if (!gtk_widget_get_realized(gui.mainwin))
- {
- width += get_menu_tool_width();
- height += get_menu_tool_height();
- gtk_window_set_default_size(GTK_WINDOW(gui.mainwin), width, height);
- }
+ width += get_menu_tool_width();
+ height += get_menu_tool_height();
+ gtk_window_set_default_size(GTK_WINDOW(gui.mainwin), width, height);
}

void
diff --git a/src/version.c b/src/version.c
index 2b51332c9..9decaeea3 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 521,
/**/
520,
/**/
Reply all
Reply to author
Forward
0 new messages