--- a/vim7/src/gui.c	2009-09-21 05:38:00.000000000 +0400
+++ b/vim7/src/gui.c	2009-09-21 05:38:09.000000000 +0400
@@ -1400,6 +1400,12 @@
     }
 #endif
 
+#ifdef HAVE_GTK2
+    /* Do not resize shell in maximized window, unmaximize it first. */
+    if (mustset && gui_mch_maximized())
+	gui_mch_unmaximize();
+#endif
+
     base_width = gui_get_base_width();
     base_height = gui_get_base_height();
 #ifdef USE_SUN_WORKSHOP
--- a/vim7/src/gui_gtk_x11.c	2009-09-21 05:38:00.000000000 +0400
+++ b/vim7/src/gui_gtk_x11.c	2009-09-21 05:38:07.000000000 +0400
@@ -4370,6 +4370,17 @@
 #endif /* HAVE_GTK2 */
 
 /*
+ * Unmaximize the main window
+ */
+    void
+gui_mch_unmaximize()
+{
+#if defined(HAVE_GTK2)
+    gtk_window_unmaximize(GTK_WINDOW(gui.mainwin));
+#endif
+}
+
+/*
  * Return TRUE if the GUI window is maximized, filling the whole screen.
  */
     int
