From 3e9aae7a913b8507a61271c89ef7b8b77e2d49cf Mon Sep 17 00:00:00 2001 From: David Benbennick Date: Sat, 15 Aug 2009 20:02:35 +0200 Subject: [PATCH] Fix mixing pixels when maximizing borderless windows 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. Submitted-by: Gilbert Ashley --- src/actions.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/actions.c b/src/actions.c index 1ecaaa4c..b7aa85cf 100644 --- a/src/actions.c +++ b/src/actions.c @@ -437,7 +437,9 @@ wMaximizeWindow(WWindow *wwin, int directions) 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; @@ -448,7 +450,9 @@ wMaximizeWindow(WWindow *wwin, int directions) } 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;