diff options
author | Tudor Brindus <me@tbrindus.ca> | 2020-10-31 19:56:40 -0400 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2020-11-01 03:43:00 -0500 |
commit | 60d95414d4a7ff163099c9e551ec435cb0cb7eca (patch) | |
tree | 1a4bcf041850390d00f05e78884dab51b4ef0c35 /sway/commands | |
parent | 8c12e71a66feb1cac545dc8746f817772eb77d2f (diff) |
commands/focus: force container warp when fulfilling `focus mode_toggle`
This commit switches focusing behavior to force a warp when executing
`focus mode_toggle`.
Fixes #5772.
Diffstat (limited to 'sway/commands')
-rw-r--r-- | sway/commands/focus.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c index 56c3d981..79b7aed5 100644 --- a/sway/commands/focus.c +++ b/sway/commands/focus.c @@ -268,7 +268,16 @@ static struct cmd_results *focus_mode(struct sway_workspace *ws, } if (new_focus) { seat_set_focus_container(seat, new_focus); - seat_consider_warp_to_focus(seat); + + // If we're on the floating layer and the floating container area + // overlaps the position on the tiling layer that would be warped to, + // `seat_consider_warp_to_focus` would decide not to warp, but we need + // to anyway. + if (config->mouse_warping == WARP_CONTAINER) { + cursor_warp_to_container(seat->cursor, new_focus, true); + } else { + seat_consider_warp_to_focus(seat); + } } else { return cmd_results_new(CMD_FAILURE, "Failed to find a %s container in workspace", |