From e4fcd515fe8089a547f23ce7d0089607b35d44e2 Mon Sep 17 00:00:00 2001 From: Nicolas Bonifas Date: Sat, 12 Sep 2009 19:45:58 +0200 Subject: [PATCH] Maximizing a resized window When a maximized window is resized (either using wmaker or because the application changed the window size), and you want to maximize it again, you first have to unmaximize it (because wmaker thinks the window is still maximized), and only then you can maximize it. The following patch corrects this behaviour. --- src/client.c | 7 ++++++- src/moveres.c | 16 ++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/client.c b/src/client.c index 1fdab42a..95dfe269 100644 --- a/src/client.c +++ b/src/client.c @@ -254,7 +254,12 @@ void wClientConfigure(WWindow * wwin, XConfigureRequestEvent * xcre) else nheight = wwin->frame->core->height - wwin->frame->top_width - wwin->frame->bottom_width; - wWindowConfigure(wwin, nx, ny, nwidth, nheight); + if (nwidth != wwin->old_geometry.width) + wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_MAXIMUS); + if (nheight != wwin->old_geometry.height) + wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS); + + wWindowConfigure(wwin, nx, ny, nwidth, nheight); wwin->old_geometry.x = nx; wwin->old_geometry.y = ny; wwin->old_geometry.width = nwidth; diff --git a/src/moveres.c b/src/moveres.c index 86193ee8..f2b6966a 100644 --- a/src/moveres.c +++ b/src/moveres.c @@ -1510,11 +1510,15 @@ int wKeyboardMoveResizeWindow(WWindow * wwin) } } } else { - if (wwin->client.width != ww) + if (wwin->client.width != ww) { wwin->flags.user_changed_width = 1; + wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_MAXIMUS); + } - if (wwin->client.height != wh - vert_border) + if (wwin->client.height != wh - vert_border) { wwin->flags.user_changed_height = 1; + wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS); + } wWindowConfigure(wwin, src_x + off_x, src_y + off_y, ww, wh - vert_border); wWindowSynthConfigureNotify(wwin); @@ -2070,11 +2074,15 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev) WMUnmapWidget(scr->gview); XUngrabServer(dpy); - if (wwin->client.width != fw) + if (wwin->client.width != fw) { wwin->flags.user_changed_width = 1; + wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_MAXIMUS); + } - if (wwin->client.height != fh - vert_border) + if (wwin->client.height != fh - vert_border) { wwin->flags.user_changed_height = 1; + wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS); + } wWindowConfigure(wwin, fx, fy, fw, fh - vert_border); }