From 1669da719c96e80cc5c462bbd648b17c7cd25a82 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 9 Aug 2015 19:32:03 -0400 Subject: [PATCH] Destroy containers when all views are removed --- sway/layout.c | 4 ++++ 1 file changed, 4 insertions(+) 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) {