|
|
0b0bd3 |
From 78d09336391faf6e3fe9f67771b03114f23c0b7c Mon Sep 17 00:00:00 2001
|
|
|
0b0bd3 |
From: Carlos Garnacho <carlosg@gnome.org>
|
|
|
0b0bd3 |
Date: Thu, 2 Jan 2014 21:33:30 +0100
|
|
|
0b0bd3 |
Subject: [PATCH] Xi: Ensure DeviceChanged is emitted after grabs are
|
|
|
0b0bd3 |
deactivated
|
|
|
0b0bd3 |
|
|
|
0b0bd3 |
When a grab on a slave device is deactivated, the master device must
|
|
|
0b0bd3 |
be checked, just in case there were events from other devices while
|
|
|
0b0bd3 |
the slave device was stolen away by the passive grab. This may
|
|
|
0b0bd3 |
introduce misbehaviors on mismatching valuators and device features
|
|
|
0b0bd3 |
later on UpdateDeviceState().
|
|
|
0b0bd3 |
|
|
|
0b0bd3 |
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
|
|
|
0b0bd3 |
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
0b0bd3 |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
0b0bd3 |
(cherry picked from commit b2d5ee2e3684951b611fd2068d57cc65fd8305a3)
|
|
|
0b0bd3 |
---
|
|
|
0b0bd3 |
Xi/exevents.c | 19 ++++++++++++++++++-
|
|
|
0b0bd3 |
1 file changed, 18 insertions(+), 1 deletion(-)
|
|
|
0b0bd3 |
|
|
|
0b0bd3 |
diff --git a/Xi/exevents.c b/Xi/exevents.c
|
|
|
0b0bd3 |
index ed6dc36..6b9561e 100644
|
|
|
0b0bd3 |
--- a/Xi/exevents.c
|
|
|
0b0bd3 |
+++ b/Xi/exevents.c
|
|
|
0b0bd3 |
@@ -1783,8 +1783,25 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
|
|
|
0b0bd3 |
DeliverDeviceEvents(GetSpriteWindow(device), (InternalEvent *) event,
|
|
|
0b0bd3 |
NullGrab, NullWindow, device);
|
|
|
0b0bd3 |
|
|
|
0b0bd3 |
- if (deactivateDeviceGrab == TRUE)
|
|
|
0b0bd3 |
+ if (deactivateDeviceGrab == TRUE) {
|
|
|
0b0bd3 |
(*device->deviceGrab.DeactivateGrab) (device);
|
|
|
0b0bd3 |
+
|
|
|
0b0bd3 |
+ if (!IsMaster (device) && !IsFloating (device)) {
|
|
|
0b0bd3 |
+ int flags, num_events = 0;
|
|
|
0b0bd3 |
+ InternalEvent dce;
|
|
|
0b0bd3 |
+
|
|
|
0b0bd3 |
+ flags = (IsPointerDevice (device)) ?
|
|
|
0b0bd3 |
+ DEVCHANGE_POINTER_EVENT : DEVCHANGE_KEYBOARD_EVENT;
|
|
|
0b0bd3 |
+ UpdateFromMaster (&dce, device, flags, &num_events);
|
|
|
0b0bd3 |
+ BUG_WARN(num_events > 1);
|
|
|
0b0bd3 |
+
|
|
|
0b0bd3 |
+ if (num_events == 1)
|
|
|
0b0bd3 |
+ ChangeMasterDeviceClasses(GetMaster (device, MASTER_ATTACHED),
|
|
|
0b0bd3 |
+ &dce.changed_event);
|
|
|
0b0bd3 |
+ }
|
|
|
0b0bd3 |
+
|
|
|
0b0bd3 |
+ }
|
|
|
0b0bd3 |
+
|
|
|
0b0bd3 |
event->detail.key = key;
|
|
|
0b0bd3 |
}
|
|
|
0b0bd3 |
|
|
|
0b0bd3 |
--
|
|
|
0b0bd3 |
1.9.0
|
|
|
0b0bd3 |
|