Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git
command/zoom: always warp cursor if configured
Focus may not actually change here so seat.focus() may not automatically
warp the cursor. Nevertheless, a cursor warp seems to be what users
expect with `set-cursor-warp on-focus` configured, especially in
combination with focus-follows-cursor.
river/command/zoom.zig | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/river/command/zoom.zig b/river/command/zoom.zig
index 0a16eb6..7db3500 100644
--- a/river/command/zoom.zig
+++ b/river/command/zoom.zig
@@ -76,6 +76,10 @@ pub fn zoom(
target.pending_wm_stack_link.remove();
output.pending.wm_stack.prepend(target);
seat.focus(target);
+ // Focus may not actually change here so seat.focus() may not automatically warp the cursor.
+ // Nevertheless, a cursor warp seems to be what users expect with `set-cursor-warp on-focus`
+ // configured, especially in combination with focus-follows-cursor.
+ seat.cursor.may_need_warp = true;
server.root.applyPending();
}
}