aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix/events.c')
-rw-r--r--xorg-server/dix/events.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index 9d9565b95..cb9440b7c 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -1441,6 +1441,7 @@ UpdateTouchesForGrab(DeviceIntPtr mouse)
ti->listeners[0].type = LISTENER_POINTER_GRAB;
else
ti->listeners[0].type = LISTENER_GRAB;
+ ti->listeners[0].grab = grab;
}
}
}
@@ -1524,7 +1525,7 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
emulate a ButtonRelease here. So pretend the listener
already has the end event */
if (grab->grabtype == CORE || grab->grabtype == XI ||
- !xi2mask_isset(dev->deviceGrab.grab->xi2mask, dev, XI_TouchBegin))
+ !xi2mask_isset(mouse->deviceGrab.grab->xi2mask, mouse, XI_TouchBegin))
ti->listeners[0].state = LISTENER_HAS_END;
TouchListenerAcceptReject(mouse, ti, 0, XIRejectTouch);
}
@@ -1553,15 +1554,6 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
ReattachToOldMaster(mouse);
ComputeFreezes();
-
- /* If an explicit grab was deactivated, we must remove it from the head of
- * all the touches' listener lists. */
- for (i = 0; mouse->touch && i < mouse->touch->num_touches; i++) {
- TouchPointInfoPtr ti = mouse->touch->touches + i;
-
- if (ti->active && TouchResourceIsOwner(ti, grab_resource))
- TouchListenerAcceptReject(mouse, ti, 0, XIRejectTouch);
- }
}
/**
@@ -2249,7 +2241,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
* @return TRUE if the event should be discarded, FALSE otherwise.
*/
static BOOL
-FilterRawEvents(const ClientPtr client, const GrabPtr grab)
+FilterRawEvents(const ClientPtr client, const GrabPtr grab, WindowPtr root)
{
XIClientPtr client_xi_version;
int cmp;
@@ -2265,7 +2257,10 @@ FilterRawEvents(const ClientPtr client, const GrabPtr grab)
client_xi_version->minor_version, 2, 0);
/* XI 2.0: if device is grabbed, skip
XI 2.1: if device is grabbed by us, skip, we've already delivered */
- return (cmp == 0) ? TRUE : SameClient(grab, client);
+ if (cmp == 0)
+ return TRUE;
+
+ return (grab->window != root) ? FALSE : SameClient(grab, client);
}
/**
@@ -2318,7 +2313,7 @@ DeliverRawEvent(RawDeviceEvent *ev, DeviceIntPtr device)
*/
ic.next = NULL;
- if (!FilterRawEvents(rClient(&ic), grab))
+ if (!FilterRawEvents(rClient(&ic), grab, root))
DeliverEventToInputClients(device, &ic, root, xi, 1,
filter, NULL, &c, &m);
}