summaryrefslogtreecommitdiffstats
path: root/mouse.c
diff options
context:
space:
mode:
Diffstat (limited to 'mouse.c')
-rw-r--r--mouse.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/mouse.c b/mouse.c
index 2b5d63b..07b533c 100644
--- a/mouse.c
+++ b/mouse.c
@@ -42,7 +42,7 @@ mresize(Client *c)
42 42
43 old_cx = c->r[RFloat].x; 43 old_cx = c->r[RFloat].x;
44 old_cy = c->r[RFloat].y; 44 old_cy = c->r[RFloat].y;
45 if(XGrabPointer(dpy, c->win, False, MouseMask, GrabModeAsync, GrabModeAsync, 45 if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync,
46 None, cursor[CurResize], CurrentTime) != GrabSuccess) 46 None, cursor[CurResize], CurrentTime) != GrabSuccess)
47 return; 47 return;
48 XGrabServer(dpy); 48 XGrabServer(dpy);
@@ -55,10 +55,12 @@ mresize(Client *c)
55 case MotionNotify: 55 case MotionNotify:
56 XUngrabServer(dpy); 56 XUngrabServer(dpy);
57 mmatch(c, old_cx, old_cy, ev.xmotion.x, ev.xmotion.y); 57 mmatch(c, old_cx, old_cy, ev.xmotion.x, ev.xmotion.y);
58 resize(c); 58 XResizeWindow(dpy, c->win, c->r[RFloat].width, c->r[RFloat].height);
59 XGrabServer(dpy); 59 XGrabServer(dpy);
60 break; 60 break;
61 case ButtonRelease: 61 case ButtonRelease:
62 resize(c);
63 XUngrabServer(dpy);
62 XUngrabPointer(dpy, CurrentTime); 64 XUngrabPointer(dpy, CurrentTime);
63 return; 65 return;
64 } 66 }
@@ -75,7 +77,7 @@ mmove(Client *c)
75 77
76 old_cx = c->r[RFloat].x; 78 old_cx = c->r[RFloat].x;
77 old_cy = c->r[RFloat].y; 79 old_cy = c->r[RFloat].y;
78 if(XGrabPointer(dpy, c->win, False, MouseMask, GrabModeAsync, GrabModeAsync, 80 if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync,
79 None, cursor[CurMove], CurrentTime) != GrabSuccess) 81 None, cursor[CurMove], CurrentTime) != GrabSuccess)
80 return; 82 return;
81 XQueryPointer(dpy, root, &dummy, &dummy, &x1, &y1, &di, &di, &dui); 83 XQueryPointer(dpy, root, &dummy, &dummy, &x1, &y1, &di, &di, &dui);
@@ -88,10 +90,12 @@ mmove(Client *c)
88 XUngrabServer(dpy); 90 XUngrabServer(dpy);
89 c->r[RFloat].x = old_cx + (ev.xmotion.x - x1); 91 c->r[RFloat].x = old_cx + (ev.xmotion.x - x1);
90 c->r[RFloat].y = old_cy + (ev.xmotion.y - y1); 92 c->r[RFloat].y = old_cy + (ev.xmotion.y - y1);
91 resize(c); 93 XMoveResizeWindow(dpy, c->win, c->r[RFloat].x, c->r[RFloat].y,
94 c->r[RFloat].width, c->r[RFloat].height);
92 XGrabServer(dpy); 95 XGrabServer(dpy);
93 break; 96 break;
94 case ButtonRelease: 97 case ButtonRelease:
98 resize(c);
95 XUngrabServer(dpy); 99 XUngrabServer(dpy);
96 XUngrabPointer(dpy, CurrentTime); 100 XUngrabPointer(dpy, CurrentTime);
97 return; 101 return;