Hi,

On 11/24/2014 01:46 AM, Peter Hutterer wrote:
Prep work for changing seat names on devices. No functional changes.

Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>

Looks good:

Reviewed-by: Hans de Goede <hdego...@redhat.com>

Regards,

Hans

---
  src/udev-seat.c | 13 ++++++++-----
  1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/udev-seat.c b/src/udev-seat.c
index 49c8f47..c69d175 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);


_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to