summaryrefslogtreecommitdiff
path: root/src/udev-seat.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-01-30 16:33:24 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-09-18 11:31:23 +1000
commit8be1abf58ad855ba25f48db5a7196c85dda1ff25 (patch)
tree887199140b043577bf7040cd586550d00751b35c /src/udev-seat.c
parent3e93d913bef339311976a927091674fb7f1f4987 (diff)
evdev: don't resume a removed device
A device may disappear and a new device may re-appear with the same device node while the original device is suspended. Prevent a device resume to open the wrong device. In a path context, a changing syspath is the only indicator we get of the device changing. In a udev context, if the device was removed and libinput_dispatch() was called, we can short-cut the syspath comparison by setting it to NULL. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'src/udev-seat.c')
-rw-r--r--src/udev-seat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/udev-seat.c b/src/udev-seat.c
index ccff35c5..f2be66e3 100644
--- a/src/udev-seat.c
+++ b/src/udev-seat.c
@@ -47,6 +47,7 @@ device_added(struct udev_device *udev_device, struct udev_input *input)
struct evdev_device *device;
const char *devnode;
const char *sysname;
+ const char *syspath;
const char *device_seat, *seat_name, *output_name;
const char *calibration_values;
float calibration[6];
@@ -61,6 +62,7 @@ device_added(struct udev_device *udev_device, struct udev_input *input)
devnode = udev_device_get_devnode(udev_device);
sysname = udev_device_get_sysname(udev_device);
+ syspath = udev_device_get_syspath(udev_device);
/* Search for matching logical seat */
seat_name = udev_device_get_property_value(udev_device, "WL_SEAT");
@@ -77,7 +79,7 @@ device_added(struct udev_device *udev_device, struct udev_input *input)
return -1;
}
- device = evdev_device_create(&seat->base, devnode, sysname);
+ device = evdev_device_create(&seat->base, devnode, sysname, syspath);
libinput_seat_unref(&seat->base);
if (device == EVDEV_UNHANDLED_DEVICE) {