Cursor: don't hide while pointer constraint active

Fixes: https://codeberg.org/river/river/issues/1053
This commit is contained in:
Isaac Freund 2024-05-12 10:42:19 +02:00
parent e29d66f1de
commit f66eec9248
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -769,6 +769,14 @@ fn handleRequestSetCursor(
pub fn hide(cursor: *Cursor) void { pub fn hide(cursor: *Cursor) void {
if (cursor.pressed_count > 0) return; 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.hidden = true;
cursor.wlr_cursor.unsetImage(); cursor.wlr_cursor.unsetImage();
cursor.xcursor_name = null; cursor.xcursor_name = null;