diff options
author | Daniel Stone <daniel@fooishbar.org> | 2006-08-07 23:02:17 +0300 |
---|---|---|
committer | Daniel Stone <daniels@endtroducing.fooishbar.org> | 2006-08-07 23:02:17 +0300 |
commit | 458c63a84110f64c7fce397a531a3a779c2239a2 (patch) | |
tree | b4a244a1ee5e13e600492ce9c9847a9b6edac8db /dix | |
parent | a31d11a7a8485cdc799f76c4d407d3b7f7c9b350 (diff) |
enable adding devices after removal of a middle device
Allow new devices to be added after a device that _wasn't_ the last on the
list was removed, by ensuring inputInfo.numDevices always increases, and
never decreases.
Diffstat (limited to 'dix')
-rw-r--r-- | dix/devices.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/dix/devices.c b/dix/devices.c index 1d423e273..69f1e7bcc 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -536,7 +536,7 @@ RemoveDevice(DeviceIntPtr dev) ErrorF("want to remove device %p, kb is %p, pointer is %p\n", dev, inputInfo.keyboard, inputInfo.pointer); #endif - if (!dev) + if (!dev || dev == inputInfo.keyboard || dev == inputInfo.pointer) return BadImplementation; prev = NULL; @@ -550,13 +550,6 @@ RemoveDevice(DeviceIntPtr dev) else prev->next = next; - inputInfo.numDevices--; - - if (inputInfo.keyboard == tmp) - inputInfo.keyboard = NULL; - else if (inputInfo.pointer == tmp) - inputInfo.pointer = NULL; - ret = Success; } } @@ -572,13 +565,6 @@ RemoveDevice(DeviceIntPtr dev) else prev->next = next; - inputInfo.numDevices--; - - if (inputInfo.keyboard == tmp) - inputInfo.keyboard = NULL; - else if (inputInfo.pointer == tmp) - inputInfo.pointer = NULL; - ret = Success; } } |