? struts-patch.diff
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/metacity/ChangeLog,v
retrieving revision 1.852
diff -u -r1.852 ChangeLog
--- ChangeLog	13 Aug 2004 00:38:53 -0000	1.852
+++ ChangeLog	13 Aug 2004 16:27:13 -0000
@@ -1,3 +1,11 @@
+2004-08-13 Bill Haneman <billh@gnome.org>
+
+	* src/window.c: 
+	(meta_window_update_struts):
+	Allow struts larger than 1/2 the screen width/height,
+	as long as there's a minimum sized gap between them.
+	Fixes bug #144126.
+	
 2004-08-13 Gurban M. Tewekgeli  <gmtavakkoli@yahoo.com>
 	* po/tk.po: Added Turkmen translation.
 	* configure.in: Added "tk" to ALL_LINGUAS.
Index: src/window.c
===================================================================
RCS file: /cvs/gnome/metacity/src/window.c,v
retrieving revision 1.338
diff -u -r1.338 window.c
--- src/window.c	8 Aug 2004 16:18:52 -0000	1.338
+++ src/window.c	13 Aug 2004 16:27:13 -0000
@@ -5248,7 +5248,7 @@
   MetaRectangle new_top;
   MetaRectangle new_bottom;
 
-#define MIN_EMPTY (75)
+#define MIN_EMPTY (15)
   
   meta_verbose ("Updating struts for %s\n", window->desc);
   
@@ -5298,15 +5298,16 @@
         }
       else
         {
+          int gap;
+	  gap = window->screen->width - struts[0] - struts[1];
+	  gap -= MIN_EMPTY;
           new_has_struts = TRUE;
-          new_left.width = MIN ((int)struts[0], 
-                                window->screen->width/2 - MIN_EMPTY);
-          new_right.width = MIN ((int)struts[1], 
-                                 window->screen->width/2 - MIN_EMPTY);
-          new_top.height = MIN ((int)struts[2], 
-                                window->screen->height/2 - MIN_EMPTY);
-          new_bottom.height = MIN ((int)struts[3], 
-                                   window->screen->height/2 - MIN_EMPTY);
+          new_left.width = (int) struts[0] + MIN(0, gap/2);
+          new_right.width = (int) struts[1] + MIN(0, gap/2);
+	  gap = window->screen->width - struts[0] - struts[1];
+	  gap -= MIN_EMPTY;
+          new_top.height = (int)struts[2] + MIN(0, gap/2);
+          new_bottom.height = (int)struts[3] + MIN(0, gap/2);
           new_right.x = window->screen->width - 
             new_right.width;
           new_bottom.y = window->screen->height - 
@@ -5350,22 +5351,23 @@
             }
           else
             {
-              new_has_struts = TRUE;
-              new_left.width = MIN ((int)struts[0], 
-                                    window->screen->width/2 - MIN_EMPTY);
-              new_right.width = MIN ((int)struts[1], 
-                                     window->screen->width/2 - MIN_EMPTY);
-              new_top.height = MIN ((int)struts[2], 
-                                    window->screen->height/2 - MIN_EMPTY);
-              new_bottom.height = MIN ((int)struts[3], 
-                                       window->screen->height/2 - MIN_EMPTY);
-              new_left.x = 0;
-              new_right.x = window->screen->width - 
-                new_right.width;
-              new_top.y = 0;
-              new_bottom.y = window->screen->height -
-                new_bottom.height;
-          
+	      int gap;
+	      gap = window->screen->width - struts[0] - struts[1];
+	      gap -= MIN_EMPTY;
+	      new_has_struts = TRUE;
+	      new_left.width = (int) struts[0] + MIN(0, gap/2);
+	      new_right.width = (int) struts[1] + MIN(0, gap/2);
+	      gap = window->screen->width - struts[0] - struts[1];
+	      gap -= MIN_EMPTY;
+	      new_top.height = (int)struts[2] + MIN(0, gap/2);
+	      new_bottom.height = (int)struts[3] + MIN(0, gap/2);
+	      new_left.x = 0;
+	      new_right.x = window->screen->width - 
+		new_right.width;
+	      new_top.y = 0;
+	      new_bottom.y = window->screen->height -
+		new_bottom.height;
+	      
               meta_verbose ("_NET_WM_STRUT struts %d %d %d %d for window %s\n",
                             new_left.width,
                             new_right.width,
