In a GTK2/X11 build, when a gVim window is maximized (with a panel below 
it, preventing Vim from occupying
the lower pixels of the screen) and the user opens a second tab, causing 
the GUI tab-bar to appear, gVim incorrectly
assumes it can further enlarge the window, and pushes the commandline 
portion of the interface below the visible
portion of the window. In order to make the commandline visible again, 
one must un-maximize and re-maximize the
window.

I know about the 'guiheadroom', but it seems like a hack to me. Change 
window-managers, change the wm's theme,
change X's DPI (perhaps just by adding/removing an external monitor to a 
laptop) and this value may no longer be
accurate. And then of course, there is also the case where one changes 
the size of the panel.

I see two ways this can be corrected:
1. Figure out the correct "available" screen-size based on all the 
NET_WM_STRUT_PARTIAL and NET_WM_STRUT properties.
This still doesn't account for window-manager border and titlebar sizes 
though, and I see computing the available size as the
window-manager's job.

2. Don't attempt to make the window any bigger if it is currently 
maximized. This keeps the commandline visible when the gui
tabbar is toggled on in a maximized window.

The attached patch modifies gui_mch_get_screen_dimensions in 
gui_gtk_x11.c to force the window to remain the main size
if it is maximized, thus avoiding the problem.

-Geoffrey Antos

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Index: src/gui_gtk_x11.c
===================================================================
--- src/gui_gtk_x11.c   (revision 1000)
+++ src/gui_gtk_x11.c   (working copy)
@@ -4374,6 +4374,22 @@
 #endif
 }
 
+/*
+ * 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;
+}
 
 /*
  * The screen size is used to make sure the initial window doesn't get bigger
@@ -4383,6 +4399,14 @@
     void
 gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
 {
+#ifdef HAVE_GTK2
+    if(gui_mch_maximized())
+    {
+    gtk_window_get_size(gui.mainwin, screen_w, screen_h);
+    }
+    else
+#endif
+    {
 #ifdef HAVE_GTK_MULTIHEAD
     GdkScreen* screen;
 
@@ -4399,6 +4423,7 @@
      * window manager (task list and window title bar). */
     *screen_h = gdk_screen_height() - p_ghr;
 #endif
+    }
 
     /*
      * FIXME: dirty trick: Because the gui_get_base_height() doesn't include

Raspunde prin e-mail lui