[PATCH multitouch] Xi: only activate the device grab if we don't already have one

Peter Hutterer peter.hutterer at who-t.net
Tue Dec 20 20:47:40 PST 2011


If the device is already grabbed, don't activate the passive grab, it screws
with our event masks. Just deliver to the grabbing client instead.

Reported-by: Carlos Garnacho <carlosg at gnome.org>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 Xi/exevents.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 0849690..db49e31 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1385,8 +1385,8 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent
     if (grab)
     {
         /* this side-steps the usual activation mechansims, but... */
-        if (ev->any.type == ET_TouchBegin)
-            ActivatePassiveGrab(dev, grab, ptrev, ev); /* also delivers the event */
+        if (ev->any.type == ET_TouchBegin && !dev->deviceGrab.grab)
+                ActivatePassiveGrab(dev, grab, ptrev, ev); /* also delivers the event */
         else {
             int deliveries = 0;
             /* 'grab' is the passive grab, but if the grab isn't active,
-- 
1.7.7.4


More information about the xorg-devel mailing list