udev: Use WL_OUTPUT udev attribute for pairing touchscreens to outputs
authorKristian Høgsberg <krh@bitplanet.net>
Mon, 22 Jul 2013 22:11:11 +0000 (15:11 -0700)
committerJonas Ådahl <jadahl@gmail.com>
Sat, 16 Nov 2013 20:54:07 +0000 (21:54 +0100)
src/udev-seat.c

index ec6dc4b..771d9bc 100644 (file)
@@ -45,8 +45,9 @@ device_added(struct udev_device *udev_device, struct udev_input *input)
 {
        struct weston_compositor *c;
        struct evdev_device *device;
+       struct weston_output *output;
        const char *devnode;
-       const char *device_seat, *seat_name;
+       const char *device_seat, *seat_name, *output_name;
        const char *calibration_values;
        int fd;
        struct udev_seat *seat;
@@ -120,6 +121,13 @@ device_added(struct udev_device *udev_device, struct udev_input *input)
                                     &seat->base.pointer->x,
                                     &seat->base.pointer->y);
 
+       output_name = udev_device_get_property_value(udev_device, "WL_OUTPUT");
+       if (output_name) {
+               wl_list_for_each(output, &c->output_list, link)
+                       if (strcmp(output->name, output_name) == 0)
+                               device->output = output;
+       }
+
        return 0;
 }