[PATCH 5/7] dix: disable non-sprite-owners first when disabling paired devices
Peter Hutterer
peter.hutterer at who-t.net
Tue May 15 03:36:27 PDT 2012
If a sprite-owner is to be disabled but still paired, disable the paired
device first. i.e. disabling a master pointer will disable the master
keyboard first.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
dix/devices.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dix/devices.c b/dix/devices.c
index efce5c1..47ff68f 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -458,10 +458,13 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
if (IsMaster(dev) && dev->spriteInfo->sprite) {
for (other = inputInfo.devices; other; other = other->next)
- BUG_RETURN_VAL_MSG(other->spriteInfo->paired == dev, FALSE,
- "%s still paired with %s", dev->name, other->spriteInfo->paired->name);
+ if (other->spriteInfo->paired == dev && !other->spriteInfo->spriteOwner)
+ DisableDevice(other, sendevent);
}
+ if (dev->spriteInfo->paired)
+ dev->spriteInfo->paired = NULL;
+
(void) (*dev->deviceProc) (dev, DEVICE_OFF);
dev->enabled = FALSE;
--
1.7.10.1
More information about the xorg-devel
mailing list