diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-07-21 15:33:11 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-07-21 15:33:11 +0930 |
commit | 40edbce44ea7542ae009c13fbe4658f36cfe1218 (patch) | |
tree | 50e00bc811484252e04389fa1341a3b11bacb444 | |
parent | 7b8b6a89316addc627a74aa6549f51cfa36a3ab3 (diff) |
Grab device when dragging the window.
This gets rid of the problem where moving too fast would lose the contact
point of the window.
-rw-r--r-- | src/PointerDevice.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/PointerDevice.cpp b/src/PointerDevice.cpp index 23c6de8..e8cfcc0 100644 --- a/src/PointerDevice.cpp +++ b/src/PointerDevice.cpp @@ -85,6 +85,9 @@ void PointerDevice::dragOff() XEventClass motion = evclasses[XI_MotionNotify]; XSelectExtensionEvent(x11->dpy, x11->root, &motion, 1); + XUngrabDevice(x11->dpy, this->dev, CurrentTime); + TRACE("Ungrabbing device.\n"); + XFlush(x11->dpy); } @@ -115,6 +118,7 @@ bool PointerDevice::dragOn(WMWindow* win, int x, int y) // in case we get out of the window we still need to catch the release XEventClass classes[2] = {evclasses[XI_MotionNotify], evclasses[XI_ButtonRelease]}; XSelectExtensionEvent(x11->dpy, x11->root, classes, 2); + XGrabDevice(x11->dpy, this->dev, win->getWindowBar(), False, 2, classes, GrabModeAsync, GrabModeAsync, CurrentTime); return true; } |