diff options
Diffstat (limited to 'sway/tree/root.c')
-rw-r--r-- | sway/tree/root.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sway/tree/root.c b/sway/tree/root.c index 476e47a3..6e13d6ce 100644 --- a/sway/tree/root.c +++ b/sway/tree/root.c | |||
@@ -310,10 +310,7 @@ void root_for_each_container(void (*f)(struct sway_container *con, void *data), | |||
310 | // Scratchpad | 310 | // Scratchpad |
311 | for (int i = 0; i < root->scratchpad->length; ++i) { | 311 | for (int i = 0; i < root->scratchpad->length; ++i) { |
312 | struct sway_container *container = root->scratchpad->items[i]; | 312 | struct sway_container *container = root->scratchpad->items[i]; |
313 | // If the container has a workspace then it's visible on a workspace | 313 | if (container_is_scratchpad_hidden(container)) { |
314 | // and will have been iterated in the previous for loop. So we only | ||
315 | // iterate the hidden scratchpad containers here. | ||
316 | if (!container->workspace) { | ||
317 | f(container, data); | 314 | f(container, data); |
318 | container_for_each_child(container, f, data); | 315 | container_for_each_child(container, f, data); |
319 | } | 316 | } |
@@ -362,7 +359,7 @@ struct sway_container *root_find_container( | |||
362 | // Scratchpad | 359 | // Scratchpad |
363 | for (int i = 0; i < root->scratchpad->length; ++i) { | 360 | for (int i = 0; i < root->scratchpad->length; ++i) { |
364 | struct sway_container *container = root->scratchpad->items[i]; | 361 | struct sway_container *container = root->scratchpad->items[i]; |
365 | if (!container->workspace) { | 362 | if (container_is_scratchpad_hidden(container)) { |
366 | if (test(container, data)) { | 363 | if (test(container, data)) { |
367 | return container; | 364 | return container; |
368 | } | 365 | } |