]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0521: GTK4: cannot resize shell after the window is shown v9.2.0521
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Sat, 23 May 2026 18:49:43 +0000 (18:49 +0000)
committerChristian Brabandt <cb@256bit.org>
Sat, 23 May 2026 18:49:43 +0000 (18:49 +0000)
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 <noreply@anthropic.com>
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/gui_gtk4.c
src/version.c

index 4b02fe1a71710c1687b4873f6b64e9f9e35524f3..a9c9de7caf661d0725b32db623c1880c63c7cdaf 100644 (file)
@@ -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
index 2b51332c9c5ee76b509c16b567f819a4fa3a31d2..9decaeea3cb2b1bd51b1d62f16ffe40fe1b9aeaf 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    521,
 /**/
     520,
 /**/