From 018e6ade21592bfad9d544408ccfe58134b865e4 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Tue, 18 Apr 2017 12:22:12 +0300 Subject: [PATCH] libinput: make setting the same output a no-op 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 Reviewed-by: Peter Hutterer --- libweston/libinput-device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c index d391d63..62f4cee 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.7.4