summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-06-01 16:22:51 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-06-02 10:41:10 +1000
commitb3e4810a283d369e1a2c6c3288177fe79fd1e9d6 (patch)
tree5bc0798e67797b914ef525ace6695ef56c2d9e18
parent18ae48670859d05788776e164c65985e3b35a723 (diff)
dix: move grab device assignment into GRABTYPE_CORE block.
grab->type is the device type and XI2 types overlap with core events (being less than GenericEvent). Thus, for passive grabs the grab device would be overwritten with whatever device was activating it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--dix/events.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/dix/events.c b/dix/events.c
index 3fd1dab06..8a340b673 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3461,19 +3461,6 @@ CheckPassiveGrabsOnWindow(
event->corestate &= 0x1f00;
event->corestate |= tempGrab.modifiersDetail.exact & (~0x1f00);
grabinfo = &device->deviceGrab;
- /* A passive grab may have been created for a different device
- than it is assigned to at this point in time.
- Update the grab's device and modifier device to reflect the
- current state.
- Since XGrabDeviceButton requires to specify the
- modifierDevice explicitly, we don't override this choice.
- */
- if (tempGrab.type < GenericEvent)
- {
- grab->device = device;
- grab->modifierDevice = GetPairedDevice(device);
- }
-
/* In some cases a passive core grab may exist, but the client
* already has a core grab on some other device. In this case we
* must not get the grab, otherwise we may never ungrab the
@@ -3484,6 +3471,20 @@ CheckPassiveGrabsOnWindow(
{
DeviceIntPtr other;
BOOL interfering = FALSE;
+
+ /* A passive grab may have been created for a different device
+ than it is assigned to at this point in time.
+ Update the grab's device and modifier device to reflect the
+ current state.
+ Since XGrabDeviceButton requires to specify the
+ modifierDevice explicitly, we don't override this choice.
+ */
+ if (tempGrab.type < GenericEvent)
+ {
+ grab->device = device;
+ grab->modifierDevice = GetPairedDevice(device);
+ }
+
for (other = inputInfo.devices; other; other = other->next)
{
GrabPtr othergrab = other->deviceGrab.grab;