I can't see any reason why we would treat buttons > 5 differently.  This
patch simplifies client code by eliminating the need to call XGrabDevice
after a button has been pressed and prevents race conditions that could
result from that.

Tom
>From cc4a046ac387bd03c1cba1d017bdc1ced75b44d0 Mon Sep 17 00:00:00 2001
From: Thomas Jaeger <[email protected]>
Date: Sat, 20 Dec 2008 16:17:02 +0100
Subject: [PATCH] Don't release grabs unless all buttons are up

Previously, only buttons <= 5 would count here.
---
 Xi/exevents.c |    2 +-
 dix/events.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 083bb2f..6d4a146 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1069,7 +1069,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
 	    xE->u.u.detail = key;
 	    return;
 	}
-        if (!b->state && device->deviceGrab.fromPassiveGrab)
+        if (!b->buttonsDown && device->deviceGrab.fromPassiveGrab)
             deactivateDeviceGrab = TRUE;
     }
 
diff --git a/dix/events.c b/dix/events.c
index d7618c2..bd56f3b 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3846,7 +3846,7 @@ ProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count)
 	    if (xE->u.u.detail == 0)
 		return;
             filters[mouse->id][Motion_Filter(butc)] = MotionNotify;
-	    if (!butc->state && mouse->deviceGrab.fromPassiveGrab)
+	    if (!butc->buttonsDown && mouse->deviceGrab.fromPassiveGrab)
 		deactivateGrab = TRUE;
 	    break;
 	default:
-- 
1.5.6.3

_______________________________________________
xorg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xorg

Reply via email to