aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-08-09 19:32:03 -0400
committerDrew DeVault <sir@cmpwn.com>2015-08-09 19:32:03 -0400
commit1669da719c96e80cc5c462bbd648b17c7cd25a82 (patch)
tree4ba478ccd45bbbfe03ae93c16fc9fa3b40109ffb
parent22315865696264aeef296364c7fc420b972a10fb (diff)
Destroy containers when all views are removed
-rw-r--r--sway/layout.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/layout.c b/sway/layout.c
index 2ce0a559..6bb19d63 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -216,6 +216,10 @@ void destroy_view(swayc_t *view) {
}
arrange_windows(parent, -1, -1);
+
+ if (parent->children->length == 0 && parent->type == C_CONTAINER) {
+ destroy_view(parent);
+ }
}
void unfocus_all(swayc_t *container) {