diff options
author | lbonn <bonnans.l@gmail.com> | 2021-01-20 22:20:00 +0100 |
---|---|---|
committer | Tudor Brindus <me@tbrindus.ca> | 2021-02-25 09:40:20 -0500 |
commit | c6e7cf1ae554f36e5120962ace779737827ad088 (patch) | |
tree | 6071546edfe33925f7f205414166e62fbfd6d819 /sway/commands | |
parent | eea9c6331f01729d5feb8f86a4c0bbb53012d292 (diff) |
focus: beyond fullscreen when focused explicitly
When issuing a focus command on a specific container, users expect to
proceed it even if is hidden by a fullscreen window.
This matches the behavior of i3.
Diffstat (limited to 'sway/commands')
-rw-r--r-- | sway/commands/focus.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c index 6b4f57c1..6771ca2f 100644 --- a/sway/commands/focus.c +++ b/sway/commands/focus.c @@ -377,6 +377,13 @@ struct cmd_results *cmd_focus(int argc, char **argv) { if (container_is_scratchpad_hidden_or_child(container)) { root_scratchpad_show(container); } + // if we are switching to a container under a fullscreen window, we first + // need to exit fullscreen so that the newly focused container becomes visible + struct sway_container *obstructing = container_obstructing_fullscreen_container(container); + if (obstructing) { + container_fullscreen_disable(obstructing); + arrange_root(); + } seat_set_focus_container(seat, container); seat_consider_warp_to_focus(seat); container_raise_floating(container); |