[Xquartz-changes] xserver: Branch 'server-1.8-apple'
Jeremy Huddleston
jeremyhu at freedesktop.org
Sat Feb 13 00:49:23 PST 2010
dix/events.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
New commits:
commit cf0058494209f98f540f54c2c0db74ab1e481af9
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date: Fri Jan 15 11:39:36 2010 +1000
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 at who-t.net>
Tested-by: Jim Ramsay <i.am at jimramsay.com>
diff --git a/dix/events.c b/dix/events.c
index 85c8f9a..b854d98 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3580,6 +3580,8 @@ CheckPassiveGrabsOnWindow(
xE = &core;
count = 1;
mask = grab->eventMask;
+ if (grab->ownerEvents)
+ mask |= pWin->eventMask;
} else if (match & XI2_MATCH)
{
rc = EventToXI2((InternalEvent*)event, &xE);
@@ -3601,6 +3603,24 @@ CheckPassiveGrabsOnWindow(
mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
else if (event->type == XI_Enter || event->type == XI_FocusIn)
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
{
rc = EventToXI((InternalEvent*)event, &xE, &count);
@@ -3612,6 +3632,22 @@ CheckPassiveGrabsOnWindow(
continue;
}
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);
More information about the Xquartz-changes
mailing list