From 587a37dc60f48b64d96f88364cc3aa79740573a3 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Sun, 9 Jun 2013 13:18:18 +0100 Subject: [PATCH] Maximization regression wMaximizeWindow() was previously rewritten and simplified. Unfortunately the rewrite introduced a regression with windows which were horizontally maximized or Maximusized, whereby they would be too small after the maximization. The bug is easy to see by opening a standard 80x24 terminal and hitting the maximize horizontally shortcut. The terminal shrinks to 21 lines. Pressing the shortcut key again correctly restores it to 80x24. The fix is to refrain from shrinking the final window height, which is done to account for its frame border and titlebar, for the affected maximization styles. --- src/actions.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/actions.c b/src/actions.c index 1417833a..e492419a 100644 --- a/src/actions.c +++ b/src/actions.c @@ -410,8 +410,6 @@ void wMaximizeWindow(WWindow *wwin, int directions) new_height += wwin->frame->bottom_width - 1; new_y -= wwin->frame->top_width; } - /* HACK: this will be subtracted again below */ - new_height += wwin->frame->top_width + wwin->frame->bottom_width; wwin->maximus_x = new_x; wwin->maximus_y = new_y; @@ -457,7 +455,7 @@ void wMaximizeWindow(WWindow *wwin, int directions) } } - if (!WFLAGP(wwin, full_maximize)) + if (!WFLAGP(wwin, full_maximize) && !(directions == MAX_MAXIMUS || directions == MAX_HORIZONTAL)) new_height -= wwin->frame->top_width + wwin->frame->bottom_width; /* set maximization state */ -- 2.11.4.GIT