From 2bb282cd45cb8149b39d72397ef5bbcfebca11d2 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 21 Dec 2011 14:45:27 +1000 Subject: [PATCH] Xi: only activate the device grab if we don't already have one 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 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas --- Xi/exevents.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 084969097..db49e31b8 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,