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/input | |
parent | eea9c6331f01729d5feb8f86a4c0bbb53012d292 (diff) | |
download | sway-c6e7cf1ae554f36e5120962ace779737827ad088.tar.xz |
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/input')
-rw-r--r-- | sway/input/seat.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index d23525a8..2d714acd 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -1139,26 +1139,15 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) { struct sway_container *container = node->type == N_CONTAINER ? node->sway_container : NULL; - // Deny setting focus to a view which is hidden by a fullscreen container - if (new_workspace && new_workspace->fullscreen && container && - !container_is_fullscreen_or_child(container)) { - // Unless it's a transient container - if (!container_is_transient_for(container, new_workspace->fullscreen)) { - return; - } + // Deny setting focus to a view which is hidden by a fullscreen container or global + if (container && container_obstructing_fullscreen_container(container)) { + return; } + // Deny setting focus to a workspace node when using fullscreen global if (root->fullscreen_global && !container && new_workspace) { return; } - // Deny setting focus to a view which is hidden by a fullscreen global - if (root->fullscreen_global && container != root->fullscreen_global && - !container_has_ancestor(container, root->fullscreen_global)) { - // Unless it's a transient container - if (!container_is_transient_for(container, root->fullscreen_global)) { - return; - } - } struct sway_output *new_output = new_workspace ? new_workspace->output : NULL; |