aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/container.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index cb407f0e..d9fc61e7 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -77,7 +77,7 @@ struct sway_container *container_create(enum sway_container_type type) {
return c;
}
-static struct sway_container *_container_destroy(struct sway_container *cont) {
+static struct sway_container *container_finish(struct sway_container *cont) {
if (cont == NULL) {
return NULL;
}
@@ -124,13 +124,13 @@ static void reap_empty_func(struct sway_container *con, void *data) {
break;
case C_CONTAINER:
if (con->children->length == 0) {
- _container_destroy(con);
+ container_finish(con);
} else if (con->children->length == 1) {
struct sway_container *only_child = con->children->items[0];
if (only_child->type == C_CONTAINER) {
container_remove_child(only_child);
container_replace_child(con, only_child);
- _container_destroy(con);
+ container_finish(con);
}
}
case C_VIEW:
@@ -146,6 +146,7 @@ struct sway_container *container_reap_empty(struct sway_container *container) {
return parent;
}
+
void container_destroy(struct sway_container *cont) {
if (cont == NULL) {
return;
@@ -155,7 +156,7 @@ void container_destroy(struct sway_container *cont) {
assert(false && "dont destroy containers with children");
}
- _container_destroy(cont);
+ container_finish(cont);
container_reap_empty(&root_container);
}