diff options
Diffstat (limited to 'sway/container.c')
-rw-r--r-- | sway/container.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sway/container.c b/sway/container.c index 67a34551..127e1ecd 100644 --- a/sway/container.c +++ b/sway/container.c | |||
@@ -299,7 +299,8 @@ swayc_t *destroy_workspace(swayc_t *workspace) { | |||
299 | return NULL; | 299 | return NULL; |
300 | } | 300 | } |
301 | 301 | ||
302 | if (workspace->children->length == 0) { | 302 | // Do not destroy if there are children |
303 | if (workspace->children->length == 0 && workspace->floating->length == 0) { | ||
303 | sway_log(L_DEBUG, "%s: '%s'", __func__, workspace->name); | 304 | sway_log(L_DEBUG, "%s: '%s'", __func__, workspace->name); |
304 | swayc_t *parent = workspace->parent; | 305 | swayc_t *parent = workspace->parent; |
305 | free_swayc(workspace); | 306 | free_swayc(workspace); |
@@ -466,14 +467,16 @@ bool swayc_is_fullscreen(swayc_t *view) { | |||
466 | // Mapping | 467 | // Mapping |
467 | 468 | ||
468 | void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data) { | 469 | void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data) { |
469 | if (container && container->children && container->children->length) { | 470 | if (container) { |
470 | int i; | 471 | int i; |
471 | for (i = 0; i < container->children->length; ++i) { | 472 | if (container->children) { |
472 | swayc_t *child = container->children->items[i]; | 473 | for (i = 0; i < container->children->length; ++i) { |
473 | f(child, data); | 474 | swayc_t *child = container->children->items[i]; |
474 | container_map(child, f, data); | 475 | f(child, data); |
476 | container_map(child, f, data); | ||
477 | } | ||
475 | } | 478 | } |
476 | if (container->type == C_WORKSPACE) { | 479 | if (container->floating) { |
477 | for (i = 0; i < container->floating->length; ++i) { | 480 | for (i = 0; i < container->floating->length; ++i) { |
478 | swayc_t *child = container->floating->items[i]; | 481 | swayc_t *child = container->floating->items[i]; |
479 | f(child, data); | 482 | f(child, data); |