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.
This commit is contained in:
Isaac Freund 2024-02-10 12:00:14 +01:00
parent 026c832ba1
commit 93b8bbc2fd
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -76,6 +76,10 @@ pub fn zoom(
target.pending_wm_stack_link.remove(); target.pending_wm_stack_link.remove();
output.pending.wm_stack.prepend(target); output.pending.wm_stack.prepend(target);
seat.focus(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(); server.root.applyPending();
} }
} }