struct weston_compositor *c = device->seat->compositor;
struct weston_output *output;
- if (!device->output_name) {
+ if (!device->output_name && !wl_list_empty(&c->output_list)) {
output = container_of(c->output_list.next,
struct weston_output, link);
evdev_device_set_output(device, output);
struct weston_compositor *c = device->seat->compositor;
struct weston_output *output;
- if (!device->output_name) {
+ if (!device->output_name && !wl_list_empty(&c->output_list)) {
output = container_of(c->output_list.next,
struct weston_output, link);
evdev_device_set_output(device, output);
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);
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);
}
+
+ if (device->output_name == NULL && device->output == NULL)
+ evdev_device_set_output(device, output);
+ }
}
static struct udev_seat *
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);
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);
}
+
+ if (device->output_name == NULL && device->output == NULL)
+ evdev_device_set_output(device, output);
+ }
}
static struct udev_seat *