dix: use the event mask of the grab for TryClientEvents.

A client that grabs for button/key events may not have the
ButtonPress/KeyPress mask set and should not receive an event in that case.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-07-22 12:09:24 +10:00
parent 4dc91b3e54
commit 48585bd1e3

View File

@ -3347,6 +3347,7 @@ CheckPassiveGrabsOnWindow(
{ {
DeviceIntPtr gdev; DeviceIntPtr gdev;
XkbSrvInfoPtr xkbi = NULL; XkbSrvInfoPtr xkbi = NULL;
Mask mask;
gdev= grab->modifierDevice; gdev= grab->modifierDevice;
if (grab->grabtype == GRABTYPE_CORE) if (grab->grabtype == GRABTYPE_CORE)
@ -3461,6 +3462,7 @@ CheckPassiveGrabsOnWindow(
} }
xE = &core; xE = &core;
count = 1; count = 1;
mask = grab->eventMask;
} else if (match & XI2_MATCH) } else if (match & XI2_MATCH)
{ {
rc = EventToXI2((InternalEvent*)event, &xE); rc = EventToXI2((InternalEvent*)event, &xE);
@ -3472,6 +3474,7 @@ CheckPassiveGrabsOnWindow(
continue; continue;
} }
count = 1; count = 1;
mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
} else } else
{ {
rc = EventToXI((InternalEvent*)event, &xE, &count); rc = EventToXI((InternalEvent*)event, &xE, &count);
@ -3482,6 +3485,7 @@ CheckPassiveGrabsOnWindow(
"(%d, %d).\n", device->name, event->type, rc); "(%d, %d).\n", device->name, event->type, rc);
continue; continue;
} }
mask = grab->eventMask;
} }
(*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE); (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
@ -3490,8 +3494,7 @@ CheckPassiveGrabsOnWindow(
{ {
FixUpEventFromWindow(device, xE, grab->window, None, TRUE); FixUpEventFromWindow(device, xE, grab->window, None, TRUE);
TryClientEvents(rClient(grab), device, xE, count, TryClientEvents(rClient(grab), device, xE, count, mask,
GetEventFilter(device, xE),
GetEventFilter(device, xE), grab); GetEventFilter(device, xE), grab);
} }