libinput: make setting the same output a no-op
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 18 Apr 2017 09:22:12 +0000 (12:22 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Fri, 20 Apr 2018 12:27:54 +0000 (15:27 +0300)
In the future evdev_device_set_output() will start getting called more
often, redundantly. Short-circuit the setting if the chosen output is
already set for an input device. This reduces churn in the logs.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
libweston/libinput-device.c

index d391d63..62f4cee 100644 (file)
@@ -549,6 +549,9 @@ void
 evdev_device_set_output(struct evdev_device *device,
                        struct weston_output *output)
 {
+       if (device->output == output)
+               return;
+
        if (device->output_destroy_listener.notify) {
                wl_list_remove(&device->output_destroy_listener.link);
                device->output_destroy_listener.notify = NULL;