diff options
author | 2021-01-20 22:20:00 +0100 | |
---|---|---|
committer | 2021-02-25 09:40:20 -0500 | |
commit | c6e7cf1ae554f36e5120962ace779737827ad088 (patch) | |
tree | 6071546edfe33925f7f205414166e62fbfd6d819 /sway/input/seat.c | |
parent | Automatically map built-in touchscreens/tablets to built-in panels (diff) | |
download | sway-c6e7cf1ae554f36e5120962ace779737827ad088.tar.gz sway-c6e7cf1ae554f36e5120962ace779737827ad088.tar.zst sway-c6e7cf1ae554f36e5120962ace779737827ad088.zip |
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/seat.c')
-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) { | |||
1139 | struct sway_container *container = node->type == N_CONTAINER ? | 1139 | struct sway_container *container = node->type == N_CONTAINER ? |
1140 | node->sway_container : NULL; | 1140 | node->sway_container : NULL; |
1141 | 1141 | ||
1142 | // Deny setting focus to a view which is hidden by a fullscreen container | 1142 | // Deny setting focus to a view which is hidden by a fullscreen container or global |
1143 | if (new_workspace && new_workspace->fullscreen && container && | 1143 | if (container && container_obstructing_fullscreen_container(container)) { |
1144 | !container_is_fullscreen_or_child(container)) { | 1144 | return; |
1145 | // Unless it's a transient container | ||
1146 | if (!container_is_transient_for(container, new_workspace->fullscreen)) { | ||
1147 | return; | ||
1148 | } | ||
1149 | } | 1145 | } |
1146 | |||
1150 | // Deny setting focus to a workspace node when using fullscreen global | 1147 | // Deny setting focus to a workspace node when using fullscreen global |
1151 | if (root->fullscreen_global && !container && new_workspace) { | 1148 | if (root->fullscreen_global && !container && new_workspace) { |
1152 | return; | 1149 | return; |
1153 | } | 1150 | } |
1154 | // Deny setting focus to a view which is hidden by a fullscreen global | ||
1155 | if (root->fullscreen_global && container != root->fullscreen_global && | ||
1156 | !container_has_ancestor(container, root->fullscreen_global)) { | ||
1157 | // Unless it's a transient container | ||
1158 | if (!container_is_transient_for(container, root->fullscreen_global)) { | ||
1159 | return; | ||
1160 | } | ||
1161 | } | ||
1162 | 1151 | ||
1163 | struct sway_output *new_output = | 1152 | struct sway_output *new_output = |
1164 | new_workspace ? new_workspace->output : NULL; | 1153 | new_workspace ? new_workspace->output : NULL; |