diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2013-07-22 15:11:11 -0700 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2013-11-16 21:54:07 +0100 |
commit | 71d66e22e5f77e7bf29e8a925ea480cdf84826e0 (patch) | |
tree | c666c7c006de3ef452f4e31b11e40a429a2debad /src | |
parent | dcaca098f8d5afd0e60141058c89093741a5eeb3 (diff) |
udev: Use WL_OUTPUT udev attribute for pairing touchscreens to outputs
Diffstat (limited to 'src')
-rw-r--r-- | src/udev-seat.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/udev-seat.c b/src/udev-seat.c index ec6dc4b8..771d9bcf 100644 --- a/src/udev-seat.c +++ b/src/udev-seat.c @@ -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; } |