diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c index 62f4cee8..dbbaae32 100644 --- a/libweston/libinput-device.c +++ b/libweston/libinput-device.c @@ -442,7 +442,7 @@ notify_output_destroy(struct wl_listener *listener, void *data) struct weston_output, link); evdev_device_set_output(device, output); } else { - device->output = NULL; + evdev_device_set_output(device, NULL); } } @@ -557,6 +557,14 @@ evdev_device_set_output(struct evdev_device *device, device->output_destroy_listener.notify = NULL; } + if (!output) { + weston_log("output for input device %s removed\n", + libinput_device_get_sysname(device->device)); + + device->output = NULL; + return; + } + weston_log("associating input device %s with output %s " "(%s by udev)\n", libinput_device_get_sysname(device->device),