debug-gui: avoid locking pointer twice
authorJosé Expósito <jose.exposito89@gmail.com>
Mon, 10 Oct 2022 06:14:55 +0000 (08:14 +0200)
committerJosé Expósito <jose.exposito89@gmail.com>
Mon, 10 Oct 2022 08:46:30 +0000 (08:46 +0000)
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 <jose.exposito89@gmail.com>
tools/libinput-debug-gui.c

index 309c0450292f3871bf335f52de7dbd0d238745f2..60df2ae5c84b3a4f78dec1cc4503da726309ea18 100644 (file)
@@ -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())