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 | input: remove motion deltas from seatop callbacks (diff) | |
download | sway-60d95414d4a7ff163099c9e551ec435cb0cb7eca.tar.gz sway-60d95414d4a7ff163099c9e551ec435cb0cb7eca.tar.zst sway-60d95414d4a7ff163099c9e551ec435cb0cb7eca.zip |
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, | |||
268 | } | 268 | } |
269 | if (new_focus) { | 269 | if (new_focus) { |
270 | seat_set_focus_container(seat, new_focus); | 270 | seat_set_focus_container(seat, new_focus); |
271 | seat_consider_warp_to_focus(seat); | 271 | |
272 | // If we're on the floating layer and the floating container area | ||
273 | // overlaps the position on the tiling layer that would be warped to, | ||
274 | // `seat_consider_warp_to_focus` would decide not to warp, but we need | ||
275 | // to anyway. | ||
276 | if (config->mouse_warping == WARP_CONTAINER) { | ||
277 | cursor_warp_to_container(seat->cursor, new_focus, true); | ||
278 | } else { | ||
279 | seat_consider_warp_to_focus(seat); | ||
280 | } | ||
272 | } else { | 281 | } else { |
273 | return cmd_results_new(CMD_FAILURE, | 282 | return cmd_results_new(CMD_FAILURE, |
274 | "Failed to find a %s container in workspace", | 283 | "Failed to find a %s container in workspace", |