dix: float attached devices _before_ disabling the master.

It also helps if we're actually providing the correct argument to
AttachDevice...
This commit is contained in:
Peter Hutterer 2008-04-15 14:29:53 +09:30
parent 4cf9c5909d
commit 48d33ab9b6

View File

@ -301,6 +301,16 @@ DisableDevice(DeviceIntPtr dev)
if (*prev != dev)
return FALSE;
/* float attached devices */
if (dev->isMaster)
{
for (other = inputInfo.devices; other; other = other->next)
{
if (other->u.master == dev)
AttachDevice(NULL, other, NULL);
}
}
if (dev->isMaster && dev->spriteInfo->sprite)
{
for (other = inputInfo.devices; other; other = other->next)
@ -320,16 +330,6 @@ DisableDevice(DeviceIntPtr dev)
dev->next = inputInfo.off_devices;
inputInfo.off_devices = dev;
/* float attached devices */
if (dev->isMaster)
{
for (other = inputInfo.devices; other; other = other->next)
{
if (other->u.master == dev)
AttachDevice(NULL, dev, NULL);
}
}
ev.type = DevicePresenceNotify;
ev.time = currentTime.milliseconds;
ev.devchange = DeviceDisabled;