From: Pekka Paalanen <pekka.paala...@collabora.co.uk>

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.paala...@collabora.co.uk>
---
 libweston/libinput-device.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c
index d391d63e..62f4cee8 100644
--- a/libweston/libinput-device.c
+++ b/libweston/libinput-device.c
@@ -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;
-- 
2.16.1

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to