comparison src/gui.c @ 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 cd5c83115ec6
children acbb1a815e7c
comparison
equal deleted inserted replaced
16173:1b998e6cd49b 16174:0f3c50a68637
679 gui.shell_created = TRUE; 679 gui.shell_created = TRUE;
680 680
681 #ifndef FEAT_GUI_GTK 681 #ifndef FEAT_GUI_GTK
682 // Set the shell size, adjusted for the screen size. For GTK this only 682 // Set the shell size, adjusted for the screen size. For GTK this only
683 // works after the shell has been opened, thus it is further down. 683 // works after the shell has been opened, thus it is further down.
684 // For MS-Windows pass FALSE for "mustset" to make --windowid work. 684 // If the window is already maximized (e.g. when --windowid is passed in),
685 gui_set_shellsize(FALSE, TRUE, RESIZE_BOTH); 685 // we want to use the system-provided dimensions by passing FALSE to
686 // mustset. Otherwise, we want to initialize with the default rows/columns.
687 if (gui_mch_maximized())
688 gui_set_shellsize(FALSE, TRUE, RESIZE_BOTH);
689 else
690 gui_set_shellsize(TRUE, TRUE, RESIZE_BOTH);
686 #endif 691 #endif
687 #if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU) 692 #if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU)
688 /* Need to set the size of the menubar after all the menus have been 693 /* Need to set the size of the menubar after all the menus have been
689 * created. */ 694 * created. */
690 gui_mch_compute_menu_height((Widget)0); 695 gui_mch_compute_menu_height((Widget)0);
719 gui_mch_update(); 724 gui_mch_update();
720 } 725 }
721 # endif 726 # endif
722 727
723 /* Now make sure the shell fits on the screen. */ 728 /* Now make sure the shell fits on the screen. */
724 gui_set_shellsize(TRUE, TRUE, RESIZE_BOTH); 729 if (gui_mch_maximized())
730 gui_set_shellsize(FALSE, TRUE, RESIZE_BOTH);
731 else
732 gui_set_shellsize(TRUE, TRUE, RESIZE_BOTH);
725 #endif 733 #endif
726 /* When 'lines' was set while starting up the topframe may have to be 734 /* When 'lines' was set while starting up the topframe may have to be
727 * resized. */ 735 * resized. */
728 win_new_shellsize(); 736 win_new_shellsize();
729 737
904 gui_mch_set_fontset(gui.fontset); 912 gui_mch_set_fontset(gui.fontset);
905 else 913 else
906 # endif 914 # endif
907 gui_mch_set_font(gui.norm_font); 915 gui_mch_set_font(gui.norm_font);
908 #endif 916 #endif
909 gui_set_shellsize(TRUE, TRUE, RESIZE_BOTH); 917 gui_set_shellsize(FALSE, TRUE, RESIZE_BOTH);
910 } 918 }
911 919
912 return ret; 920 return ret;
913 } 921 }
914 922