sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit e7ecb001d70c71f799547d15cd45c235412af402
parent f7a20726fc82c7eee1fe6756eb3aefebecb34ce6
Author: Tony Crisci <tony@dubstepdish.com>
Date:   Sat, 31 Mar 2018 13:20:05 -0400

reap container parent on destroy

Diffstat:
Msway/commands/kill.c | 1-
Msway/tree/container.c | 7++++++-
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/sway/commands/kill.c b/sway/commands/kill.c @@ -19,7 +19,6 @@ struct cmd_results *cmd_kill(int argc, char **argv) { break; case C_CONTAINER: con = container_destroy(con); - con = container_reap_empty(con); arrange_windows(con, -1, -1); break; case C_VIEW: diff --git 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;