From 717894b007d020399176c8e1afd51f0c2d048313 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sun, 12 May 2024 10:42:19 +0200 Subject: [PATCH] Cursor: don't hide while pointer constraint active Fixes: https://codeberg.org/river/river/issues/1053 (cherry picked from commit f66eec92482dabb782d5457caef4ca1dbfb82b59) --- river/Cursor.zig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/river/Cursor.zig b/river/Cursor.zig index 3b4e0a3..29e7ed9 100644 --- a/river/Cursor.zig +++ b/river/Cursor.zig @@ -769,6 +769,14 @@ fn handleRequestSetCursor( pub fn hide(cursor: *Cursor) void { if (cursor.pressed_count > 0) return; + + // Hiding the cursor and sending wl_pointer.leave whlie a pointer constraint + // is active does not make much sense. In particular, doing so seems to interact + // poorly with Xwayland's pointer constraints implementation. + if (cursor.constraint) |constraint| { + if (constraint.state == .active) return; + } + cursor.hidden = true; cursor.wlr_cursor.unsetImage(); cursor.xcursor_name = null;