summaryrefslogtreecommitdiff
path: root/src/udev-seat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/udev-seat.c')
-rw-r--r--src/udev-seat.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/udev-seat.c b/src/udev-seat.c
index 7e4330a3..8e7405d0 100644
--- a/src/udev-seat.c
+++ b/src/udev-seat.c
@@ -125,7 +125,7 @@ device_added(struct udev_device *udev_device, struct udev_input *input)
wl_list_for_each(output, &c->output_list, link)
if (strcmp(output->name, device->output_name) == 0)
evdev_device_set_output(device, output);
- } else if (device->output == NULL) {
+ } else if (device->output == NULL && !wl_list_empty(&c->output_list)) {
output = container_of(c->output_list.next,
struct weston_output, link);
evdev_device_set_output(device, output);
@@ -357,12 +357,15 @@ notify_output_create(struct wl_listener *listener, void *data)
struct evdev_device *device;
struct weston_output *output = data;
- wl_list_for_each(device, &seat->devices_list, link)
+ wl_list_for_each(device, &seat->devices_list, link) {
if (device->output_name &&
strcmp(output->name, device->output_name) == 0) {
evdev_device_set_output(device, output);
- break;
}
+
+ if (device->output_name == NULL && device->output == NULL)
+ evdev_device_set_output(device, output);
+ }
}
static struct udev_seat *
@@ -372,9 +375,9 @@ udev_seat_create(struct udev_input *input, const char *seat_name)
struct udev_seat *seat;
seat = zalloc(sizeof *seat);
-
if (!seat)
return NULL;
+
weston_seat_init(&seat->base, c, seat_name);
seat->base.led_update = drm_led_update;