|
|
|
@ -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"); |
|
|
|
|
if (output_name) { |
|
|
|
|
device->output_name = strdup(output_name); |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -343,6 +344,20 @@ drm_led_update(struct weston_seat *seat_base, enum weston_led 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 * |
|
|
|
|
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); |
|
|
|
|
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); |
|
|
|
|
return seat; |
|
|
|
|
} |
|
|
|
@ -363,6 +382,7 @@ static void |
|
|
|
|
udev_seat_destroy(struct udev_seat *seat) |
|
|
|
|
{ |
|
|
|
|
weston_seat_release(&seat->base); |
|
|
|
|
wl_list_remove(&seat->output_create_listener.link); |
|
|
|
|
free(seat); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|