diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2018-12-14 13:59:54 -0500 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2018-12-14 13:59:54 -0500 |
commit | c2499772b991a7e7a9384263810e3655da63c928 (patch) | |
tree | 778316e751e7934014197d400d98ab22c7604442 | |
parent | Rework default output configs (diff) | |
download | sway-c2499772b991a7e7a9384263810e3655da63c928.tar.gz sway-c2499772b991a7e7a9384263810e3655da63c928.tar.zst sway-c2499772b991a7e7a9384263810e3655da63c928.zip |
Fix focusing on non-visible workspace
My previous attempt was not quite right. Changing the focus stack on a
non-visible workspace should only be blocked if the focus would be set
to the workspace itself
-rw-r--r-- | sway/input/seat.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 1dd99cb2..f4098eb0 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -159,14 +159,6 @@ static void handle_seat_node_destroy(struct wl_listener *listener, void *data) { | |||
159 | return; | 159 | return; |
160 | } | 160 | } |
161 | 161 | ||
162 | if (node->type == N_CONTAINER && | ||
163 | !workspace_is_visible(node->sway_container->workspace)) { | ||
164 | // Do not change the focus stack on a non-visible workspace. The focus | ||
165 | // will either be set when the workspace becomes visible or the | ||
166 | // workspace is now empty and will be destroyed | ||
167 | return; | ||
168 | } | ||
169 | |||
170 | // Find new focus_inactive (ie. sibling, or workspace if no siblings left) | 162 | // Find new focus_inactive (ie. sibling, or workspace if no siblings left) |
171 | struct sway_node *next_focus = NULL; | 163 | struct sway_node *next_focus = NULL; |
172 | while (next_focus == NULL) { | 164 | while (next_focus == NULL) { |
@@ -182,6 +174,12 @@ static void handle_seat_node_destroy(struct wl_listener *listener, void *data) { | |||
182 | parent = node_get_parent(parent); | 174 | parent = node_get_parent(parent); |
183 | } | 175 | } |
184 | 176 | ||
177 | if (next_focus->type == N_WORKSPACE && | ||
178 | !workspace_is_visible(next_focus->sway_workspace)) { | ||
179 | // Do not change focus to a non-visible workspace | ||
180 | return; | ||
181 | } | ||
182 | |||
185 | if (needs_new_focus) { | 183 | if (needs_new_focus) { |
186 | // The structure change might have caused it to move up to the top of | 184 | // The structure change might have caused it to move up to the top of |
187 | // the focus stack without sending focus notifications to the view | 185 | // the focus stack without sending focus notifications to the view |