From: Pekka Paalanen Date: Tue, 18 Apr 2017 09:22:12 +0000 (+0300) Subject: libinput: make setting the same output a no-op X-Git-Tag: upstream/5.0.0~140 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=018e6ade21592bfad9d544408ccfe58134b865e4;p=platform%2Fupstream%2Fweston.git 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 --- 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;