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 <carlosg@gnome.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
This commit is contained in:
Peter Hutterer 2011-12-21 14:45:27 +10:00
parent 475ef5cc83
commit 2bb282cd45

View File

@ -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,