mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 17:20:04 +01:00
udev: Use WL_OUTPUT udev attribute for pairing touchscreens to outputs
This commit is contained in:
parent
dcaca098f8
commit
71d66e22e5
1 changed files with 9 additions and 1 deletions
|
|
@ -45,8 +45,9 @@ device_added(struct udev_device *udev_device, struct udev_input *input)
|
||||||
{
|
{
|
||||||
struct weston_compositor *c;
|
struct weston_compositor *c;
|
||||||
struct evdev_device *device;
|
struct evdev_device *device;
|
||||||
|
struct weston_output *output;
|
||||||
const char *devnode;
|
const char *devnode;
|
||||||
const char *device_seat, *seat_name;
|
const char *device_seat, *seat_name, *output_name;
|
||||||
const char *calibration_values;
|
const char *calibration_values;
|
||||||
int fd;
|
int fd;
|
||||||
struct udev_seat *seat;
|
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->x,
|
||||||
&seat->base.pointer->y);
|
&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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue