From b043a184509cfe5c4c4691ecde1a4a065e53d575 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 1 May 2007 09:54:33 +0930 Subject: [PATCH] Check VCP's and VCK's ids when searching for a new device id. Both VCP and VCK are not in the inputInfo.devices list anymore, so we need to check them separately. If we don't do this, we end up re-using ids 0 and 1, causing all sorts of grief for clients. --- dix/devices.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dix/devices.c b/dix/devices.c index a6e141559..27271f304 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -99,6 +99,10 @@ AddInputDevice(DeviceProc deviceProc, Bool autoStart) /* Find next available id */ memset(devind, 0, sizeof(char)*MAX_DEVICES); + if (inputInfo.keyboard) + devind[inputInfo.keyboard->id]++; + if (inputInfo.pointer) + devind[inputInfo.pointer->id]++; for (devtmp = inputInfo.devices; devtmp; devtmp = devtmp->next) devind[devtmp->id]++; for (devtmp = inputInfo.off_devices; devtmp; devtmp = devtmp->next)