From c6e7cf1ae554f36e5120962ace779737827ad088 Mon Sep 17 00:00:00 2001 From: lbonn Date: Wed, 20 Jan 2021 22:20:00 +0100 Subject: 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. --- sway/commands/focus.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sway/commands') 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); -- cgit v1.2.3