mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-23 19:00:36 +01:00
dix: don't filter RawEvents if the grab window is not the root window (#53897)
If a XI2.1+ client has a grab on a non-root window, it must still receive
raw events on the root window.
Test case: register for XI_ButtonPress on window and XI_RawMotion on root.
No raw events are received once the press activates an implicit grab on the
window.
X.Org Bug 53897 <http://bugs.freedesktop.org/show_bug.cgi?id=53897>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 4e13dd9014)
This commit is contained in:
parent
5ed2523f4d
commit
de0ea3544f
1 changed files with 6 additions and 3 deletions
|
|
@ -2240,7 +2240,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;
|
||||
|
|
@ -2256,7 +2256,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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2309,7 +2312,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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue