diff options
author | Daniel Stone <daniel.stone@nokia.com> | 2006-07-19 19:41:54 -0400 |
---|---|---|
committer | Daniel Stone <daniels@endtroducing.fooishbar.org> | 2006-07-19 19:41:54 -0400 |
commit | 1cb568c0a6c18ec62ebb89ca21a22a77c78cad24 (patch) | |
tree | 910dea85f9fa52d7922c56cb45b3f6eb84736859 /src | |
parent | 51d21a369416bb0a45a2894e83a1cb092cc307d8 (diff) |
prune device list on DEVICE_CLOSE
Remove a device from the device list when we get DEVICE_CLOSE.
Diffstat (limited to 'src')
-rw-r--r-- | src/evdev.c | 5 | ||||
-rw-r--r-- | src/evdev.h | 1 | ||||
-rw-r--r-- | src/evdev_brain.c | 17 |
3 files changed, 23 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c index f128a81..329a874 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -209,6 +209,9 @@ EvdevProc(DeviceIntPtr device, int what) EvdevKeyOff (device); } + if (what == DEVICE_CLOSE) + evdevRemoveDevice(pEvdev); + device->public.on = FALSE; break; } @@ -232,10 +235,12 @@ EvdevSwitchMode (ClientPtr client, DeviceIntPtr device, int mode) else return !Success; break; +#if 0 case SendCoreEvents: case DontSendCoreEvents: xf86XInputSetSendCoreEvents (pInfo, (mode == SendCoreEvents)); break; +#endif default: return !Success; } diff --git a/src/evdev.h b/src/evdev.h index a399571..884453a 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -243,6 +243,7 @@ int evdevGetFDForDevice (evdevDevicePtr driver); Bool evdevStart (InputDriverPtr drv); Bool evdevNewDriver (evdevDriverPtr driver); Bool evdevGetBits (int fd, evdevBitsPtr bits); +void evdevRemoveDevice (evdevDevicePtr device); int EvdevBtnInit (DeviceIntPtr device); int EvdevBtnOn (DeviceIntPtr device); diff --git a/src/evdev_brain.c b/src/evdev_brain.c index 6365577..246666f 100644 --- a/src/evdev_brain.c +++ b/src/evdev_brain.c @@ -462,6 +462,23 @@ evdevNewDriver (evdevDriverPtr driver) return TRUE; } +void +evdevRemoveDevice (evdevDevicePtr pEvdev) +{ + evdevDriverPtr driver; + evdevDevicePtr *device; + + for (driver = evdev_drivers; driver; driver = driver->next) { + for (device = &driver->devices; *device; device = &(*device)->next) { + if (*device == pEvdev) { + *device = pEvdev->next; + pEvdev->next = NULL; + return; + } + } + } +} + Bool evdevGetBits (int fd, evdevBitsPtr bits) { |