aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-04-03 23:59:44 -0400
committerTony Crisci <tony@dubstepdish.com>2018-04-03 23:59:44 -0400
commit9d1cbd77aca72ca72eaba5056de5805b14f004c1 (patch)
tree0336b4091e6f3344bfac73cc3242e1c2fd43c029
parentfa004dd0d78b922b75a6cc9c970824d18aa4e4aa (diff)
simplify container close
-rw-r--r--sway/tree/container.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 7f55ad90..57dcb4bd 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -294,18 +294,10 @@ struct sway_container *container_close(struct sway_container *con) {
struct sway_container *parent = con->parent;
- switch (con->type) {
- case C_TYPES:
- case C_ROOT:
- case C_OUTPUT:
- case C_WORKSPACE:
- case C_CONTAINER:
- container_for_each_descendant_dfs(con, container_close_func, NULL);
- break;
- case C_VIEW:
+ if (con->type == C_VIEW) {
view_close(con->sway_view);
- break;
-
+ } else {
+ container_for_each_descendant_dfs(con, container_close_func, NULL);
}
return parent;