summaryrefslogtreecommitdiffstats
path: root/src/gui_gtk_x11.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-08-10 17:44:45 +0200
committerBram Moolenaar <Bram@vim.org>2011-08-10 17:44:45 +0200
commit12bc1b5c9fa6b68993ac20a211529ff459523ada (patch)
tree02d7543ba90767aec4bf3f077b6d3e174bfe4869 /src/gui_gtk_x11.c
parent17fb0e891a0aee09a2c27660eb0ea489520aaa56 (diff)
updated for version 7.3.279v7.3.279
Problem: With GTK, when gvim is full-screen and a tab is opened and using a specific monitor configuration the window is too big. Solution: Adjust the window size like on MS-Windows. (Yukihiro Nakadaira)
Diffstat (limited to 'src/gui_gtk_x11.c')
-rw-r--r--src/gui_gtk_x11.c22
1 files changed, 16 insertions, 6 deletions
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
{