From 38b58112ac1a6b02458d8c2ff8b69f5c3d784dbe Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sun, 21 Sep 2014 08:36:51 -0500 Subject: [PATCH] wmaker: Clear maximized flag of a maximized window when moved. If a user moves a window which is currently maximized, the current behavior is to keep the window geometry and maximized status unchanged. This can lead to peculiar behavior. For example, suppose a user maximizes a window to the right half of the screen (either through the window menu, keyboard shortcut, or new snapping feature), then moves it, and then attempts maximize it to the right half of the screen again. Instead of the expected result, the window is unmaximized and returned to its original geometry. This patch changes the behavior by clearing the maximization flag when a maximized window is moved. Then, when a window is maximized and then moved, it can be maximized again without issues. Signed-off-by: Carlos R. Mafra --- src/moveres.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/moveres.c b/src/moveres.c index 6899a866..64dc50c0 100644 --- a/src/moveres.c +++ b/src/moveres.c @@ -1723,6 +1723,11 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev) } else if (abs(ev->xmotion.x_root - event.xmotion.x_root) >= MOVE_THRESHOLD || abs(ev->xmotion.y_root - event.xmotion.y_root) >= MOVE_THRESHOLD) { + if (wwin->flags.maximized) { + wwin->flags.maximized = 0; + wwin->flags.old_maximized = 0; + } + XChangeActivePointerGrab(dpy, ButtonMotionMask | ButtonReleaseMask | ButtonPressMask, wPreferences.cursor[WCUR_MOVE], CurrentTime);