Mercurial > vim
comparison src/gui.c @ 12802:29a728529f92 v8.0.1278
patch 8.0.1278: GUI window always resizes when adding scrollbar
commit https://github.com/vim/vim/commit/8ac441576fd219fb7227349e228d5b68520b204a
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 9 18:33:29 2017 +0100
patch 8.0.1278: GUI window always resizes when adding scrollbar
Problem: GUI window always resizes when adding/removing a scrollbar,
toolbar, etc.
Solution: Add the 'k' flag in 'guioptions' to keep the GUI window size and
change the number of lines/columns instead. (Ychin, closes #703)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 09 Nov 2017 18:45:04 +0100 |
parents | 351cf7c67bbe |
children | 0eb12ef4f8ba |
comparison
equal
deleted
inserted
replaced
12801:b4521872e498 | 12802:29a728529f92 |
---|---|
691 gui.shell_created = TRUE; | 691 gui.shell_created = TRUE; |
692 | 692 |
693 #ifndef FEAT_GUI_GTK | 693 #ifndef FEAT_GUI_GTK |
694 /* Set the shell size, adjusted for the screen size. For GTK this only | 694 /* Set the shell size, adjusted for the screen size. For GTK this only |
695 * works after the shell has been opened, thus it is further down. */ | 695 * works after the shell has been opened, thus it is further down. */ |
696 gui_set_shellsize(FALSE, TRUE, RESIZE_BOTH); | 696 gui_set_shellsize(TRUE, TRUE, RESIZE_BOTH); |
697 #endif | 697 #endif |
698 #if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU) | 698 #if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU) |
699 /* Need to set the size of the menubar after all the menus have been | 699 /* Need to set the size of the menubar after all the menus have been |
700 * created. */ | 700 * created. */ |
701 gui_mch_compute_menu_height((Widget)0); | 701 gui_mch_compute_menu_height((Widget)0); |
730 gui_mch_update(); | 730 gui_mch_update(); |
731 } | 731 } |
732 # endif | 732 # endif |
733 | 733 |
734 /* Now make sure the shell fits on the screen. */ | 734 /* Now make sure the shell fits on the screen. */ |
735 gui_set_shellsize(FALSE, TRUE, RESIZE_BOTH); | 735 gui_set_shellsize(TRUE, TRUE, RESIZE_BOTH); |
736 #endif | 736 #endif |
737 /* When 'lines' was set while starting up the topframe may have to be | 737 /* When 'lines' was set while starting up the topframe may have to be |
738 * resized. */ | 738 * resized. */ |
739 win_new_shellsize(); | 739 win_new_shellsize(); |
740 | 740 |
907 gui_mch_set_fontset(gui.fontset); | 907 gui_mch_set_fontset(gui.fontset); |
908 else | 908 else |
909 # endif | 909 # endif |
910 gui_mch_set_font(gui.norm_font); | 910 gui_mch_set_font(gui.norm_font); |
911 #endif | 911 #endif |
912 gui_set_shellsize(FALSE, TRUE, RESIZE_BOTH); | 912 gui_set_shellsize(TRUE, TRUE, RESIZE_BOTH); |
913 } | 913 } |
914 | 914 |
915 return ret; | 915 return ret; |
916 } | 916 } |
917 | 917 |
1551 | 1551 |
1552 /* | 1552 /* |
1553 * Set the size of the Vim shell according to Rows and Columns. | 1553 * Set the size of the Vim shell according to Rows and Columns. |
1554 * If "fit_to_display" is TRUE then the size may be reduced to fit the window | 1554 * If "fit_to_display" is TRUE then the size may be reduced to fit the window |
1555 * on the screen. | 1555 * on the screen. |
1556 * When "mustset" is TRUE the size was set by the user. When FALSE a UI | |
1557 * component was added or removed (e.g., a scrollbar). | |
1556 */ | 1558 */ |
1557 void | 1559 void |
1558 gui_set_shellsize( | 1560 gui_set_shellsize( |
1559 int mustset UNUSED, /* set by the user */ | 1561 int mustset UNUSED, |
1560 int fit_to_display, | 1562 int fit_to_display, |
1561 int direction) /* RESIZE_HOR, RESIZE_VER */ | 1563 int direction) /* RESIZE_HOR, RESIZE_VER */ |
1562 { | 1564 { |
1563 int base_width; | 1565 int base_width; |
1564 int base_height; | 1566 int base_height; |
1578 return; | 1580 return; |
1579 | 1581 |
1580 #if defined(MSWIN) || defined(FEAT_GUI_GTK) | 1582 #if defined(MSWIN) || defined(FEAT_GUI_GTK) |
1581 /* If not setting to a user specified size and maximized, calculate the | 1583 /* If not setting to a user specified size and maximized, calculate the |
1582 * number of characters that fit in the maximized window. */ | 1584 * number of characters that fit in the maximized window. */ |
1583 if (!mustset && gui_mch_maximized()) | 1585 if (!mustset && (vim_strchr(p_go, GO_KEEPWINSIZE) != NULL |
1586 || gui_mch_maximized())) | |
1584 { | 1587 { |
1585 gui_mch_newfont(); | 1588 gui_mch_newfont(); |
1586 return; | 1589 return; |
1587 } | 1590 } |
1588 #endif | 1591 #endif |