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.
---
 src/moveres.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/moveres.c b/src/moveres.c
index 6899a86..64dc50c 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);
-- 
1.9.1


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to