JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
ismax toggling on mouse based action
[dwm.git] / event.c
diff --git a/event.c b/event.c
index 1939cd5..9f120d7 100644 (file)
--- a/event.c
+++ b/event.c
@@ -49,6 +49,7 @@ movemouse(Client *c) {
        if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
                        None, cursor[CurMove], CurrentTime) != GrabSuccess)
                return;
+       c->ismax = False;
        XQueryPointer(dpy, root, &dummy, &dummy, &x1, &y1, &di, &di, &dui);
        for(;;) {
                XMaskEvent(dpy, MOUSEMASK | ExposureMask | StructureNotifyMask, &ev);
@@ -92,6 +93,7 @@ resizemouse(Client *c) {
        if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
                                None, cursor[CurResize], CurrentTime) != GrabSuccess)
                return;
+       c->ismax = False;
        XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w, c->h);
        for(;;) {
                XMaskEvent(dpy, MOUSEMASK | ExposureMask | StructureNotifyMask, &ev);
@@ -108,9 +110,9 @@ resizemouse(Client *c) {
                case MotionNotify:
                        XSync(dpy, False);
                        if((nw = abs(ocx - ev.xmotion.x)))
-                               c->w = abs(ocx - ev.xmotion.x);
+                               c->w = nw;
                        if((nh = abs(ocy - ev.xmotion.y)))
-                               c->h = abs(ocy - ev.xmotion.y);
+                               c->h = nh;
                        c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w;
                        c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - c->h;
                        if(ocx <= ev.xmotion.x)