	From: David Benbennick <dbenbenn <at> gmail.com>
	Subject: Maximizing borderless windows
	Newsgroups: gmane.compw.window-managers.windowmaker.devel
	Date: 2006-07-01 20:01:15 GMT (1 year, 48 weeks, 5 days,
	15 hours and 48 minutes ago)

	A minor bug has been bothering me for a long time.  When
	you maximize a borderless window in Window Maker, the window
	ends up too narrow and too short by two pixels.  I've 
	attached a patch against CVS to fix the problem.

diff -u -r1.75 actions.c
--- wm/src/actions.c       27 Apr 2006 19:16:58 -0000      1.75
+++ wm/src/actions.c       1 Jul 2006 19:50:25 -0000
@@ -428,7 +428,9 @@
     wwin->flags.maximized = directions;

     if (directions & MAX_HORIZONTAL) {
-        new_width = (usableArea.x2-usableArea.x1)-FRAME_BORDER_WIDTH*2;
+        new_width = usableArea.x2 - usableArea.x1;
+        if (HAS_BORDER(wwin))
+                new_width -= FRAME_BORDER_WIDTH * 2;
         new_x = usableArea.x1;
     } else if (shrink_h) {
         new_x = wwin->old_geometry.x;
@@ -439,7 +441,9 @@
     }

     if (directions & MAX_VERTICAL) {
-        new_height = (usableArea.y2-usableArea.y1)-FRAME_BORDER_WIDTH*2;
+        new_height = usableArea.y2 - usableArea.y1;
+        if (HAS_BORDER(wwin))
+                new_height -= FRAME_BORDER_WIDTH * 2;
         new_y = usableArea.y1;
         if (WFLAGP(wwin, full_maximize)) {
             new_y -= wwin->frame->top_width;

