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.
This commit is contained in:
lbonn 2021-01-20 22:20:00 +01:00 committed by Tudor Brindus
parent eea9c6331f
commit c6e7cf1ae5
4 changed files with 38 additions and 15 deletions

View file

@ -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);