aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-03-31 13:20:05 -0400
committerTony Crisci <tony@dubstepdish.com>2018-03-31 15:37:16 -0400
commite7ecb001d70c71f799547d15cd45c235412af402 (patch)
treea14ba05280f3c8b21f96b546509d5ce78b47b8ac /sway/tree
parentf7a20726fc82c7eee1fe6756eb3aefebecb34ce6 (diff)
downloadsway-e7ecb001d70c71f799547d15cd45c235412af402.tar.xz
reap container parent on destroy
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/container.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 7b88cccb..f972ac24 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -58,7 +58,7 @@ struct sway_container *container_create(enum sway_container_type type) {
return c;
}
-struct sway_container *container_destroy(struct sway_container *cont) {
+static struct sway_container *_container_destroy(struct sway_container *cont) {
if (cont == NULL) {
return NULL;
}
@@ -89,6 +89,11 @@ struct sway_container *container_destroy(struct sway_container *cont) {
return parent;
}
+struct sway_container *container_destroy(struct sway_container *cont) {
+ cont = _container_destroy(cont);
+ return container_reap_empty(cont->parent);
+}
+
struct sway_container *container_output_create(
struct sway_output *sway_output) {
struct wlr_box size;