[PATCH weston 05/25] libinput: make setting the same output a no-op

Pekka Paalanen ppaalanen at gmail.com
Fri Mar 23 12:00:45 UTC 2018


From: Pekka Paalanen <pekka.paalanen at 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.paalanen at 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



More information about the wayland-devel mailing list