diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2016-10-21 06:27:57 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2016-10-26 15:35:07 +1000 |
commit | d13cb974426f7f1110b0bdb08c4ebb46ff8975f7 (patch) | |
tree | 30ae9973ba52609e4885d260b473ad6721f8d951 /Xi | |
parent | 8fcf2fa78f09257933b17e7dc9a03a2034e3076f (diff) |
ddx: add new call to purge input devices that weren't added
Special case for the systemd-logind case in xfree86: when we're vt-switched
away and a device is plugged in, we get a paused fd from logind. Since we
can't probe the device or do anything with it, we store that device in the
xfree86 and handle it later when we vt-switch back. The device is not added to
inputInfo.devices until that time.
When the device is removed while still vt-switched away, the the config system
never notifies the DDX. It only runs through inputInfo.devices and our device
was never added to that.
When a device is plugged in, removed, and plugged in again while vt-switched
away, we have two entries in the xfree86-specific list that refer to the same
device node, both pending for addition later. On VT switch back, the first one
(the already removed one) will be added successfully, the second one (the
still plugged-in one) fails. Since the fd is correct, the device works until
it is removed again. The removed devices' config_info (i.e. the syspath)
doesn't match the actual device we addded tough (the input number increases
with each plug), it doesn't get removed, the fd remains open and we lose track
of the fd count. Plugging the device in again leads to a dead device.
Fix this by adding a call to notify the DDX to purge any remainders of devices
with the given config_info, that's the only identifiable bit we have at this
point.
https://bugs.freedesktop.org/show_bug.cgi?id=97928
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/stubs.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Xi/stubs.c b/Xi/stubs.c index 39bee7c27..27848a2f6 100644 --- a/Xi/stubs.c +++ b/Xi/stubs.c @@ -143,3 +143,17 @@ DeleteInputDeviceRequest(DeviceIntPtr dev) { RemoveDevice(dev, TRUE); } + +/**************************************************************************** + * + * Caller: configRemoveDevice (and others) + * + * Remove any traces of the input device specified in config_info. + * This is only necessary if the ddx keeps information around beyond + * the NewInputDeviceRequest/DeleteInputDeviceRequest + * + */ +void +RemoveInputDeviceTraces(const char *config_info) +{ +} |