diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2010-05-20 18:07:12 +1000 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-05-25 17:47:32 -0700 |
commit | 531ff40301975519af7b20109c17d296312d3f2b (patch) | |
tree | 181c01e61b9ed5311d69834675e1a3f16ea8bf33 /config | |
parent | c2d0b3b437b7ce6ce975f2ead4d8bb8295ef0ddc (diff) |
Add a "flags" field to DeleteInputDeviceRequest.
Some input drivers need to implement an internal hotplugging scheme for
dependent devices to provide multiple X devices off one kernel device file.
Such dependent devices can be added with NewInputDeviceRequest() but they are
not removed when the config backend calls DeleteInputDeviceRequest(),
leaving the original device to clean up.
Example of the wacom driver:
config/udev calls NewInputDeviceRequest("stylus")
wacom PreInit calls
NewInputDeviceRequest("eraser")
NewInputDeviceRequest("pad")
NewInputDeviceRequest("cursor")
PreInit finishes.
When the device is removed, the config backend only calls
DeleteInputDeviceRequest for "stylus". The driver needs to call
DeleteInputDeviceRequest for the dependent devices eraser, pad and cursor to
clean up properly.
However, when the server terminates, DeleteInputDeviceRequest is called for
all devices - the driver must not remove the dependent devices to avoid
double-frees. There is no method for the driver to detect why a device is
being removed, leading to elaborate guesswork and some amount of wishful
thinking.
Though the input driver's UnInit already supports flags, they are unused.
This patch uses the flags to supply information where the
DeleteInputDeviceRequest request originates from, allowing a driver to
selectively call DeleteInputDeviceRequest when necessary.
Also bumps XINPUT ABI.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'config')
-rw-r--r-- | config/config.c | 2 | ||||
-rw-r--r-- | config/dbus.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/config/config.c b/config/config.c index 65ef67987..f49420d0e 100644 --- a/config/config.c +++ b/config/config.c @@ -81,7 +81,7 @@ remove_device(const char *backend, DeviceIntPtr dev) * already been removed. */ OsBlockSignals(); ProcessInputEvents(); - DeleteInputDeviceRequest(dev); + DeleteInputDeviceRequest(dev, 0); OsReleaseSignals(); } diff --git a/config/dbus.c b/config/dbus.c index 72a0a05dd..511908ac1 100644 --- a/config/dbus.c +++ b/config/dbus.c @@ -226,7 +226,7 @@ remove_device(DBusMessage *message, DBusMessage *reply, DBusError *error) * already been removed. */ OsBlockSignals(); ProcessInputEvents(); - DeleteInputDeviceRequest(dev); + DeleteInputDeviceRequest(dev, 0); OsReleaseSignals(); ret = Success; |