dix: don't disable uninitialized devices.

If a device hasn't been initialized, it doesn't have a cursor yet. So don't
set the cursor to the NullCursor, and don't try to DisableDevice either.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2008-12-19 08:56:35 +10:00
parent 25aac8b579
commit 477c327087

View File

@ -965,11 +965,15 @@ RemoveDevice(DeviceIntPtr dev)
return BadImplementation;
initialized = dev->inited;
if (DevHasCursor(dev))
screen->DisplayCursor(dev, screen, NullCursor);
deviceid = dev->id;
DisableDevice(dev);
if (initialized)
{
if (DevHasCursor(dev))
screen->DisplayCursor(dev, screen, NullCursor);
DisableDevice(dev);
}
prev = NULL;
for (tmp = inputInfo.devices; tmp; (prev = tmp), (tmp = next)) {