xi: add DEVICE_ENABLE control

Add DEVICE_ENABLE control, which allows runtime enabling and disabling
of specific devices.
This commit is contained in:
Daniel Stone
2006-10-20 00:28:40 +03:00
committed by Daniel Stone
parent b0780312d8
commit a8d3dad9d9
5 changed files with 57 additions and 0 deletions

View File

@@ -130,6 +130,8 @@ AddInputDevice(DeviceProc deviceProc, Bool autoStart)
dev->devPrivates = NULL;
dev->unwrapProc = NULL;
dev->coreEvents = TRUE;
dev->inited = FALSE;
dev->enabled = FALSE;
for (prev = &inputInfo.off_devices; *prev; prev = &(*prev)->next)
;
@@ -154,6 +156,7 @@ EnableDevice(register DeviceIntPtr dev)
ErrorF("couldn't enable device %d\n", dev->id);
return FALSE;
}
dev->enabled = TRUE;
*prev = dev->next;
for (prev = &inputInfo.devices; *prev; prev = &(*prev)->next)
@@ -176,6 +179,7 @@ DisableDevice(register DeviceIntPtr dev)
if (*prev != dev)
return FALSE;
(void)(*dev->deviceProc)(dev, DEVICE_OFF);
dev->enabled = FALSE;
*prev = dev->next;
dev->next = inputInfo.off_devices;
inputInfo.off_devices = dev;