summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-02-11 15:21:51 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-02-22 14:35:44 +1000
commitdc32a23890776edf575bf18b3f3c079da6214340 (patch)
tree9d4a81a79519a53a631d5175bb8a0333c1abdfa6
parentd63c979c7fe0f2b114b27e73ebe0a706be8840ae (diff)
Fix two incorrect checks for master devices.
These two were sideeffects of lastSlave being in the same field as the master. For devices generated by the master device directly, lastSlave was 0 and the device would (with the old checks) be interpreted as floating. Add the required checks to safeguard against master devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
-rw-r--r--Xi/exevents.c3
-rw-r--r--mi/mieq.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 327873e29..b39e202ff 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -710,6 +710,9 @@ ChangeMasterDeviceClasses(DeviceIntPtr device, DeviceChangedEvent *dce)
if (rc != Success)
return; /* Device has disappeared */
+ if (IsMaster(slave))
+ return;
+
if (!slave->u.master)
return; /* set floating since the event */
diff --git a/mi/mieq.c b/mi/mieq.c
index 01da52a6c..c0020c3c3 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -325,7 +325,7 @@ CopyGetMasterEvent(DeviceIntPtr sdev,
CHECKEVENT(original);
/* ET_XQuartz has sdev == NULL */
- if (!sdev || !sdev->u.master)
+ if (!sdev || IsMaster(sdev) || !sdev->u.master)
return NULL;
#if XFreeXDGA