input: Re-pair touch screen when monitor is plugged in
https://bugs.freedesktop.org/show_bug.cgi?id=73442
This commit is contained in:
@@ -658,6 +658,7 @@ evdev_device_destroy(struct evdev_device *device)
|
|||||||
close(device->fd);
|
close(device->fd);
|
||||||
free(device->devname);
|
free(device->devname);
|
||||||
free(device->devnode);
|
free(device->devnode);
|
||||||
|
free(device->output_name);
|
||||||
free(device);
|
free(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ struct evdev_device {
|
|||||||
struct evdev_dispatch *dispatch;
|
struct evdev_dispatch *dispatch;
|
||||||
char *devnode;
|
char *devnode;
|
||||||
char *devname;
|
char *devname;
|
||||||
|
char *output_name;
|
||||||
int fd;
|
int fd;
|
||||||
struct {
|
struct {
|
||||||
int min_x, max_x, min_y, max_y;
|
int min_x, max_x, min_y, max_y;
|
||||||
|
|||||||
+21
-1
@@ -123,8 +123,9 @@ device_added(struct udev_device *udev_device, struct udev_input *input)
|
|||||||
|
|
||||||
output_name = udev_device_get_property_value(udev_device, "WL_OUTPUT");
|
output_name = udev_device_get_property_value(udev_device, "WL_OUTPUT");
|
||||||
if (output_name) {
|
if (output_name) {
|
||||||
|
device->output_name = strdup(output_name);
|
||||||
wl_list_for_each(output, &c->output_list, link)
|
wl_list_for_each(output, &c->output_list, link)
|
||||||
if (strcmp(output->name, output_name) == 0)
|
if (strcmp(output->name, device->output_name) == 0)
|
||||||
device->output = output;
|
device->output = output;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,6 +344,20 @@ drm_led_update(struct weston_seat *seat_base, enum weston_led leds)
|
|||||||
evdev_led_update(device, leds);
|
evdev_led_update(device, leds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
notify_output_create(struct wl_listener *listener, void *data)
|
||||||
|
{
|
||||||
|
struct udev_seat *seat = container_of(listener, struct udev_seat,
|
||||||
|
output_create_listener);
|
||||||
|
struct evdev_device *device;
|
||||||
|
struct weston_output *output = data;
|
||||||
|
|
||||||
|
wl_list_for_each(device, &seat->devices_list, link)
|
||||||
|
if (device->output_name &&
|
||||||
|
strcmp(output->name, device->output_name) == 0)
|
||||||
|
device->output = output;
|
||||||
|
}
|
||||||
|
|
||||||
static struct udev_seat *
|
static struct udev_seat *
|
||||||
udev_seat_create(struct weston_compositor *c, const char *seat_name)
|
udev_seat_create(struct weston_compositor *c, const char *seat_name)
|
||||||
{
|
{
|
||||||
@@ -355,6 +370,10 @@ udev_seat_create(struct weston_compositor *c, const char *seat_name)
|
|||||||
weston_seat_init(&seat->base, c, seat_name);
|
weston_seat_init(&seat->base, c, seat_name);
|
||||||
seat->base.led_update = drm_led_update;
|
seat->base.led_update = drm_led_update;
|
||||||
|
|
||||||
|
seat->output_create_listener.notify = notify_output_create;
|
||||||
|
wl_signal_add(&c->output_created_signal,
|
||||||
|
&seat->output_create_listener);
|
||||||
|
|
||||||
wl_list_init(&seat->devices_list);
|
wl_list_init(&seat->devices_list);
|
||||||
return seat;
|
return seat;
|
||||||
}
|
}
|
||||||
@@ -363,6 +382,7 @@ static void
|
|||||||
udev_seat_destroy(struct udev_seat *seat)
|
udev_seat_destroy(struct udev_seat *seat)
|
||||||
{
|
{
|
||||||
weston_seat_release(&seat->base);
|
weston_seat_release(&seat->base);
|
||||||
|
wl_list_remove(&seat->output_create_listener.link);
|
||||||
free(seat);
|
free(seat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -32,6 +32,7 @@
|
|||||||
struct udev_seat {
|
struct udev_seat {
|
||||||
struct weston_seat base;
|
struct weston_seat base;
|
||||||
struct wl_list devices_list;
|
struct wl_list devices_list;
|
||||||
|
struct wl_listener output_create_listener;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct udev_input {
|
struct udev_input {
|
||||||
@@ -42,7 +43,6 @@ struct udev_input {
|
|||||||
int enabled;
|
int enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
int udev_input_enable(struct udev_input *input, struct udev *udev);
|
int udev_input_enable(struct udev_input *input, struct udev *udev);
|
||||||
void udev_input_disable(struct udev_input *input);
|
void udev_input_disable(struct udev_input *input);
|
||||||
int udev_input_init(struct udev_input *input,
|
int udev_input_init(struct udev_input *input,
|
||||||
|
|||||||
Reference in New Issue
Block a user