summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2017-04-18 12:22:12 +0300
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2018-04-20 15:27:54 +0300
commit018e6ade21592bfad9d544408ccfe58134b865e4 (patch)
tree82942ab6d3e631f1334e054e4dadaae8307799e5
parent6632b6dc725ade9daa7136cc7096eaeea3c29d9d (diff)
downloadweston-018e6ade21592bfad9d544408ccfe58134b865e4.tar.gz
weston-018e6ade21592bfad9d544408ccfe58134b865e4.tar.bz2
weston-018e6ade21592bfad9d544408ccfe58134b865e4.zip
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 <pekka.paalanen@collabora.co.uk> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--libweston/libinput-device.c3
1 files changed, 3 insertions, 0 deletions
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;