From 72b347e681f5667b68257822e7cec02ab4c9cb6d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 7 Sep 2007 14:31:19 +0930 Subject: [PATCH] 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. --- dix/devices.c | 11 +++++++---- 1 file 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)) {