summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2007-09-07 14:31:19 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2007-09-07 14:31:19 +0930
commit72b347e681f5667b68257822e7cec02ab4c9cb6d (patch)
tree5df7e00fcd6ce3a79ddd609127615b6cd0429f4c
parentd627061b48ae06d27b37be209d67a3f4f2388dd3 (diff)
dix: Enabling devices must not overwrite existing sprites/pairing.
EnableDevices is (amongst others )called after a VT switch. We must not create a new sprite or re-pair the device, otherwise we lose the input device setup that we had before the VT switch. This requires the devices to be in exactly the same order as before the VT switch. Removing a device while on a different VT is probably a bad idea.
-rw-r--r--dix/devices.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/dix/devices.c b/dix/devices.c
index e60601636..3ce045cdd 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -210,10 +210,13 @@ EnableDevice(DeviceIntPtr dev)
/* Sprites pop up on the first root window, so we can supply it directly
* here.
*/
- if (IsPointerDevice(dev) && dev->spriteInfo->spriteOwner)
- InitializeSprite(dev, WindowTable[0]);
- else
- PairDevices(NULL, inputInfo.pointer, dev);
+ if (!dev->spriteInfo->sprite)
+ {
+ if (IsPointerDevice(dev) && dev->spriteInfo->spriteOwner)
+ InitializeSprite(dev, WindowTable[0]);
+ else
+ PairDevices(NULL, inputInfo.pointer, dev);
+ }
if ((*prev != dev) || !dev->inited ||
((ret = (*dev->deviceProc)(dev, DEVICE_ON)) != Success)) {