dix: disable non-sprite-owners first when disabling paired devices
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@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
This commit is contained in:
parent
df1704365e
commit
e433d1046c
|
@ -458,10 +458,13 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
|
||||||
|
|
||||||
if (IsMaster(dev) && dev->spriteInfo->sprite) {
|
if (IsMaster(dev) && dev->spriteInfo->sprite) {
|
||||||
for (other = inputInfo.devices; other; other = other->next)
|
for (other = inputInfo.devices; other; other = other->next)
|
||||||
BUG_RETURN_VAL_MSG(other->spriteInfo->paired == dev, FALSE,
|
if (other->spriteInfo->paired == dev && !other->spriteInfo->spriteOwner)
|
||||||
"%s still paired with %s", dev->name, other->spriteInfo->paired->name);
|
DisableDevice(other, sendevent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dev->spriteInfo->paired)
|
||||||
|
dev->spriteInfo->paired = NULL;
|
||||||
|
|
||||||
(void) (*dev->deviceProc) (dev, DEVICE_OFF);
|
(void) (*dev->deviceProc) (dev, DEVICE_OFF);
|
||||||
dev->enabled = FALSE;
|
dev->enabled = FALSE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue