diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2014-11-19 14:12:16 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2014-11-25 16:34:22 +1000 |
commit | 4c5e55a962119c6bc19373b76c5496b3320be99d (patch) | |
tree | 9bbd49265012fceb71a21f2f4d88e466a609a097 /src/udev-seat.c | |
parent | 9f225f8ea5c014a02612d34455554eab546830ee (diff) |
udev: optionally pass the seat name into device_added()
Prep work for changing seat names on devices. No functional changes.
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.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/udev-seat.c b/src/udev-seat.c index 49c8f47e..c69d175d 100644 --- a/src/udev-seat.c +++ b/src/udev-seat.c @@ -42,11 +42,13 @@ static struct udev_seat * udev_seat_get_named(struct udev_input *input, const char *seat_name); static int -device_added(struct udev_device *udev_device, struct udev_input *input) +device_added(struct udev_device *udev_device, + struct udev_input *input, + const char *seat_name) { struct evdev_device *device; const char *devnode; - const char *device_seat, *seat_name, *output_name; + const char *device_seat, *output_name; const char *calibration_values; float calibration[6]; struct udev_seat *seat; @@ -61,7 +63,8 @@ device_added(struct udev_device *udev_device, struct udev_input *input) devnode = udev_device_get_devnode(udev_device); /* Search for matching logical seat */ - seat_name = udev_device_get_property_value(udev_device, "WL_SEAT"); + if (!seat_name) + seat_name = udev_device_get_property_value(udev_device, "WL_SEAT"); if (!seat_name) seat_name = default_seat_name; @@ -161,7 +164,7 @@ udev_input_add_devices(struct udev_input *input, struct udev *udev) continue; } - if (device_added(device, input) < 0) { + if (device_added(device, input, NULL) < 0) { udev_device_unref(device); udev_enumerate_unref(e); return -1; @@ -193,7 +196,7 @@ evdev_udev_handler(void *data) goto out; if (!strcmp(action, "add")) - device_added(udev_device, input); + device_added(udev_device, input, NULL); else if (!strcmp(action, "remove")) device_removed(udev_device, input); |