|
|
e0a45bd |
From 883ed64cd23ad286250894b42c04603da85b65b5 Mon Sep 17 00:00:00 2001
|
|
|
e0a45bd |
From: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
e0a45bd |
Date: Wed, 16 Dec 2009 13:43:22 +1000
|
|
|
e0a45bd |
Subject: [PATCH] dix: if owner-events is true for passive grabs, add the window mask (#25400)
|
|
|
e0a45bd |
|
|
|
e0a45bd |
A client requesting a GrabModeSync button grab, owner-events true, with only
|
|
|
e0a45bd |
the ButtonRelease mask set would never receive the press event even if the
|
|
|
e0a45bd |
grab window had the ButtonPress mask set.
|
|
|
e0a45bd |
|
|
|
e0a45bd |
The protocol requires that if owner-events is true, then the delivery mask
|
|
|
e0a45bd |
is the combination of the grab mask + the window event mask.
|
|
|
e0a45bd |
|
|
|
e0a45bd |
X.Org Bug 25400 <http://bugs.freedesktop.org/show_bug.cgi?id=25400>
|
|
|
e0a45bd |
|
|
|
e0a45bd |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
e0a45bd |
Tested-by: Jim Ramsay <i.am@jimramsay.com>
|
|
|
e0a45bd |
---
|
|
|
e0a45bd |
dix/events.c | 36 ++++++++++++++++++++++++++++++++++++
|
|
|
e0a45bd |
1 files changed, 36 insertions(+), 0 deletions(-)
|
|
|
e0a45bd |
|
|
|
e0a45bd |
diff --git a/dix/events.c b/dix/events.c
|
|
|
e0a45bd |
index 85c8f9a..b854d98 100644
|
|
|
e0a45bd |
--- a/dix/events.c
|
|
|
e0a45bd |
+++ b/dix/events.c
|
|
|
e0a45bd |
@@ -3580,6 +3580,8 @@ CheckPassiveGrabsOnWindow(
|
|
|
e0a45bd |
xE = &cor;;
|
|
|
e0a45bd |
count = 1;
|
|
|
e0a45bd |
mask = grab->eventMask;
|
|
|
e0a45bd |
+ if (grab->ownerEvents)
|
|
|
e0a45bd |
+ mask |= pWin->eventMask;
|
|
|
e0a45bd |
} else if (match & XI2_MATCH)
|
|
|
e0a45bd |
{
|
|
|
e0a45bd |
rc = EventToXI2((InternalEvent*)event, &xE;;
|
|
|
e0a45bd |
@@ -3601,6 +3603,24 @@ CheckPassiveGrabsOnWindow(
|
|
|
e0a45bd |
mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
|
|
|
e0a45bd |
else if (event->type == XI_Enter || event->type == XI_FocusIn)
|
|
|
e0a45bd |
mask = grab->xi2mask[device->id][event->type/8];
|
|
|
e0a45bd |
+
|
|
|
e0a45bd |
+ if (grab->ownerEvents && wOtherInputMasks(grab->window))
|
|
|
e0a45bd |
+ {
|
|
|
e0a45bd |
+ InputClientsPtr icp =
|
|
|
e0a45bd |
+ wOtherInputMasks(grab->window)->inputClients;
|
|
|
e0a45bd |
+
|
|
|
e0a45bd |
+ while(icp)
|
|
|
e0a45bd |
+ {
|
|
|
e0a45bd |
+ if (rClient(icp) == rClient(grab))
|
|
|
e0a45bd |
+ {
|
|
|
e0a45bd |
+ int evtype = (xE) ? ((xGenericEvent*)xE)->evtype : event->type;
|
|
|
e0a45bd |
+ mask |= icp->xi2mask[device->id][evtype/8];
|
|
|
e0a45bd |
+ break;
|
|
|
e0a45bd |
+ }
|
|
|
e0a45bd |
+
|
|
|
e0a45bd |
+ icp = icp->next;
|
|
|
e0a45bd |
+ }
|
|
|
e0a45bd |
+ }
|
|
|
e0a45bd |
} else
|
|
|
e0a45bd |
{
|
|
|
e0a45bd |
rc = EventToXI((InternalEvent*)event, &xE, &count);
|
|
|
e0a45bd |
@@ -3612,6 +3632,22 @@ CheckPassiveGrabsOnWindow(
|
|
|
e0a45bd |
continue;
|
|
|
e0a45bd |
}
|
|
|
e0a45bd |
mask = grab->eventMask;
|
|
|
e0a45bd |
+ if (grab->ownerEvents && wOtherInputMasks(grab->window))
|
|
|
e0a45bd |
+ {
|
|
|
e0a45bd |
+ InputClientsPtr icp =
|
|
|
e0a45bd |
+ wOtherInputMasks(grab->window)->inputClients;
|
|
|
e0a45bd |
+
|
|
|
e0a45bd |
+ while(icp)
|
|
|
e0a45bd |
+ {
|
|
|
e0a45bd |
+ if (rClient(icp) == rClient(grab))
|
|
|
e0a45bd |
+ {
|
|
|
e0a45bd |
+ mask |= icp->mask[device->id];
|
|
|
e0a45bd |
+ break;
|
|
|
e0a45bd |
+ }
|
|
|
e0a45bd |
+
|
|
|
e0a45bd |
+ icp = icp->next;
|
|
|
e0a45bd |
+ }
|
|
|
e0a45bd |
+ }
|
|
|
e0a45bd |
}
|
|
|
e0a45bd |
|
|
|
e0a45bd |
(*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
|
|
|
e0a45bd |
--
|
|
|
e0a45bd |
1.6.6
|
|
|
e0a45bd |
|