diff options
-rw-r--r-- | src/gui.c | 2 | ||||
-rw-r--r-- | src/gui_gtk_x11.c | 22 | ||||
-rw-r--r-- | src/proto/gui_gtk_x11.pro | 1 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 20 insertions, 7 deletions
@@ -1407,7 +1407,7 @@ gui_set_shellsize(mustset, fit_to_display, direction) if (!gui.shell_created) return; -#ifdef MSWIN +#if defined(MSWIN) || defined(FEAT_GUI_GTK) /* If not setting to a user specified size and maximized, calculate the * number of characters that fit in the maximized window. */ if (!mustset && gui_mch_maximized()) diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index 9d95f1a48b..e2f9fc5be0 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -3900,6 +3900,21 @@ gui_mch_unmaximize() } /* + * Called when the font changed while the window is maximized. Compute the + * new Rows and Columns. This is like resizing the window. + */ + void +gui_mch_newfont() +{ + int w, h; + + gtk_window_get_size(GTK_WINDOW(gui.mainwin), &w, &h); + w -= get_menu_tool_width(); + h -= get_menu_tool_height(); + gui_resize_shell(w, h); +} + +/* * Set the windows size. */ void @@ -4409,14 +4424,9 @@ gui_mch_init_font(char_u *font_name, int fontset UNUSED) if (gui_mch_maximized()) { - int w, h; - /* Update lines and columns in accordance with the new font, keep the * window maximized. */ - gtk_window_get_size(GTK_WINDOW(gui.mainwin), &w, &h); - w -= get_menu_tool_width(); - h -= get_menu_tool_height(); - gui_resize_shell(w, h); + gui_mch_newfont(); } else { diff --git a/src/proto/gui_gtk_x11.pro b/src/proto/gui_gtk_x11.pro index 2484082b79..e395a0cfe6 100644 --- a/src/proto/gui_gtk_x11.pro +++ b/src/proto/gui_gtk_x11.pro @@ -20,6 +20,7 @@ int gui_mch_get_winpos __ARGS((int *x, int *y)); void gui_mch_set_winpos __ARGS((int x, int y)); int gui_mch_maximized __ARGS((void)); void gui_mch_unmaximize __ARGS((void)); +void gui_mch_newfont __ARGS((void)); void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height, int direction)); void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h)); void gui_mch_settitle __ARGS((char_u *title, char_u *icon)); diff --git a/src/version.c b/src/version.c index e009b8575e..8ef4fac0bb 100644 --- a/src/version.c +++ b/src/version.c @@ -710,6 +710,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 279, +/**/ 278, /**/ 277, |