summaryrefslogtreecommitdiff
path: root/dix/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'dix/events.c')
-rw-r--r--dix/events.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/dix/events.c b/dix/events.c
index 73593626e..adbb76274 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2246,7 +2246,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;
@@ -2262,7 +2262,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);
}
/**
@@ -2315,7 +2318,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);
}