--- a/vim7/src/gui_gtk_x11.c 2009-09-21 04:26:00.000000000 +0400 +++ b/vim7/src/gui_gtk_x11.c 2009-09-21 05:09:54.000000000 +0400 @@ -4370,6 +4370,23 @@ #endif /* HAVE_GTK2 */ /* + * Return TRUE if the GUI window is maximized, filling the whole screen. + */ + int +gui_mch_maximized() +{ +#if defined(HAVE_GTK2) + if(gui.mainwin != NULL) + { + GdkWindowState state = gdk_window_get_state(gui.mainwin->window); + return (state & (GDK_WINDOW_STATE_MAXIMIZED | + GDK_WINDOW_STATE_FULLSCREEN)) != 0; + } +#endif + return 0; +} + +/* * Set the windows size. */ void @@ -5237,8 +5254,21 @@ # endif #endif /* !HAVE_GTK2 */ - /* Preserve the logical dimensions of the screen. */ - update_window_manager_hints(0, 0); +#ifdef HAVE_GTK2 + if (gui_mch_maximized()) + { + /* Update shell size in accordance with the new font */ + int w; + int 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); + } + else +#endif /* !HAVE_GTK2 */ + /* Preserve the logical dimensions of the screen. */ + update_window_manager_hints(0, 0); return OK; }