changeset 16174:0f3c50a68637 v8.1.1092

patch 8.1.1092: setting 'guifont' when maximized resizes the Vim window commit https://github.com/vim/vim/commit/372674fca3250069d8f4943b572474ce077849fd Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 30 20:31:22 2019 +0100 patch 8.1.1092: setting 'guifont' when maximized resizes the Vim window Problem: Setting 'guifont' when maximized resizes the Vim window. When 'guioptions' contains "k" gvim may open with a tiny window. Solution: Avoid un-maximizing when setting 'guifont'. (Yee Cheng Chin, closes #3808)
author Bram Moolenaar <Bram@vim.org>
date Sat, 30 Mar 2019 20:45:04 +0100
parents 1b998e6cd49b
children 3994c90ff9b3
files src/gui.c src/version.c
diffstat 2 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/gui.c
+++ b/src/gui.c
@@ -681,8 +681,13 @@ gui_init(void)
 #ifndef FEAT_GUI_GTK
     // Set the shell size, adjusted for the screen size.  For GTK this only
     // works after the shell has been opened, thus it is further down.
-    // For MS-Windows pass FALSE for "mustset" to make --windowid work.
-    gui_set_shellsize(FALSE, TRUE, RESIZE_BOTH);
+    // If the window is already maximized (e.g. when --windowid is passed in),
+    // we want to use the system-provided dimensions by passing FALSE to
+    // mustset. Otherwise, we want to initialize with the default rows/columns.
+    if (gui_mch_maximized())
+	gui_set_shellsize(FALSE, TRUE, RESIZE_BOTH);
+    else
+	gui_set_shellsize(TRUE, TRUE, RESIZE_BOTH);
 #endif
 #if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU)
     /* Need to set the size of the menubar after all the menus have been
@@ -721,7 +726,10 @@ gui_init(void)
 # endif
 
 	/* Now make sure the shell fits on the screen. */
-	gui_set_shellsize(TRUE, TRUE, RESIZE_BOTH);
+	if (gui_mch_maximized())
+	    gui_set_shellsize(FALSE, TRUE, RESIZE_BOTH);
+	else
+	    gui_set_shellsize(TRUE, TRUE, RESIZE_BOTH);
 #endif
 	/* When 'lines' was set while starting up the topframe may have to be
 	 * resized. */
@@ -906,7 +914,7 @@ gui_init_font(char_u *font_list, int fon
 # endif
 	    gui_mch_set_font(gui.norm_font);
 #endif
-	gui_set_shellsize(TRUE, TRUE, RESIZE_BOTH);
+	gui_set_shellsize(FALSE, TRUE, RESIZE_BOTH);
     }
 
     return ret;
--- a/src/version.c
+++ b/src/version.c
@@ -776,6 +776,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1092,
+/**/
     1091,
 /**/
     1090,