From e8732802b7a3a45194be242a02ead13027c7fd73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Mon, 10 Oct 2022 08:14:55 +0200 Subject: [PATCH] debug-gui: avoid locking pointer twice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Sway, and probably other Wayland compositors based on wlroots, the window_lock_pointer() was called twice. Avoid errors when window_lock_pointer() is invoked multiple times. Fix https://gitlab.freedesktop.org/libinput/libinput/-/issues/808 Signed-off-by: José Expósito --- tools/libinput-debug-gui.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/libinput-debug-gui.c b/tools/libinput-debug-gui.c index 309c0450..60df2ae5 100644 --- a/tools/libinput-debug-gui.c +++ b/tools/libinput-debug-gui.c @@ -347,7 +347,8 @@ backend_is_x11(void) static bool window_lock_pointer(struct window *w) { - w->lock_pointer.locked = false; + if (w->lock_pointer.locked) + return true; #if HAVE_GTK_WAYLAND if (backend_is_wayland())