dix: if owner-events is true for passive grabs, add the window mask (#25400)
A client requesting a GrabModeSync button grab, owner-events true, with only the ButtonRelease mask set would never receive the press event even if the grab window had the ButtonPress mask set. The protocol requires that if owner-events is true, then the delivery mask is the combination of the grab mask + the window event mask. X.Org Bug 25400 <http://bugs.freedesktop.org/show_bug.cgi?id=25400> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Jim Ramsay <i.am@jimramsay.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
95ca39b981
commit
1c612acca8
36
dix/events.c
36
dix/events.c
|
@ -3552,6 +3552,8 @@ CheckPassiveGrabsOnWindow(
|
||||||
xE = &core;
|
xE = &core;
|
||||||
count = 1;
|
count = 1;
|
||||||
mask = grab->eventMask;
|
mask = grab->eventMask;
|
||||||
|
if (grab->ownerEvents)
|
||||||
|
mask |= pWin->eventMask;
|
||||||
} else if (match & XI2_MATCH)
|
} else if (match & XI2_MATCH)
|
||||||
{
|
{
|
||||||
rc = EventToXI2((InternalEvent*)event, &xE);
|
rc = EventToXI2((InternalEvent*)event, &xE);
|
||||||
|
@ -3573,6 +3575,24 @@ CheckPassiveGrabsOnWindow(
|
||||||
mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
|
mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
|
||||||
else if (event->type == XI_Enter || event->type == XI_FocusIn)
|
else if (event->type == XI_Enter || event->type == XI_FocusIn)
|
||||||
mask = grab->xi2mask[device->id][event->type/8];
|
mask = grab->xi2mask[device->id][event->type/8];
|
||||||
|
|
||||||
|
if (grab->ownerEvents && wOtherInputMasks(grab->window))
|
||||||
|
{
|
||||||
|
InputClientsPtr icp =
|
||||||
|
wOtherInputMasks(grab->window)->inputClients;
|
||||||
|
|
||||||
|
while(icp)
|
||||||
|
{
|
||||||
|
if (rClient(icp) == rClient(grab))
|
||||||
|
{
|
||||||
|
int evtype = (xE) ? ((xGenericEvent*)xE)->evtype : event->type;
|
||||||
|
mask |= icp->xi2mask[device->id][evtype/8];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
icp = icp->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
rc = EventToXI((InternalEvent*)event, &xE, &count);
|
rc = EventToXI((InternalEvent*)event, &xE, &count);
|
||||||
|
@ -3584,6 +3604,22 @@ CheckPassiveGrabsOnWindow(
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
mask = grab->eventMask;
|
mask = grab->eventMask;
|
||||||
|
if (grab->ownerEvents && wOtherInputMasks(grab->window))
|
||||||
|
{
|
||||||
|
InputClientsPtr icp =
|
||||||
|
wOtherInputMasks(grab->window)->inputClients;
|
||||||
|
|
||||||
|
while(icp)
|
||||||
|
{
|
||||||
|
if (rClient(icp) == rClient(grab))
|
||||||
|
{
|
||||||
|
mask |= icp->mask[device->id];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
icp = icp->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
|
(*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
|
||||||
|
|
Loading…
Reference in New Issue