summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2007-06-19 18:20:05 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2007-06-25 09:35:30 +0930
commit87564543d92c1ee1f8cb6fb9716a15d693e08cf5 (patch)
treeb5b06cee88e621e59a56740cb49373ab5ea1832a /Xi
parent24ee89fd60f489f2d3af0399e0d667057df74d02 (diff)
Only decrement buttonsDown when the button count is greater than 0.
Device drivers flush their buttons on device init and cause a button down event to be generated. If we unconditionally decrease the buttons, we won't be able to ever get a passive device grab. Format documentation for CheckDeviceGrabs to make it readable. (cherry picked from commit 3e894974cdd6a75683d4601f71622d1da7ec4395) Conflicts: Xi/exevents.c
Diffstat (limited to 'Xi')
-rw-r--r--Xi/exevents.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 9e71a9e4e..fe297ab6a 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -248,7 +248,9 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr other, int count)
SetMaskForEvent(Motion_Filter(b), DeviceMotionNotify);
if (!grab)
if (CheckDeviceGrabs(other, xE, 0, count))
- return;
+ /* if a passive grab was activated, the event has been sent
+ * already */
+ return;
} else if (xE->u.u.type == DeviceButtonRelease) {
if (!b)
@@ -258,7 +260,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr other, int count)
*kptr &= ~bit;
if (other->valuator)
other->valuator->motionHintWindow = NullWindow;
- if (!--b->buttonsDown)
+ if (b->buttonsDown >= 1 && !--b->buttonsDown)
b->motionMask = 0;
xE->u.u.detail = b->map[key];
if (xE->u.u.detail == 0)