reap container parent on destroy

This commit is contained in:
Tony Crisci 2018-03-31 13:20:05 -04:00
parent f7a20726fc
commit e7ecb001d7
2 changed files with 6 additions and 2 deletions

View File

@ -19,7 +19,6 @@ struct cmd_results *cmd_kill(int argc, char **argv) {
break; break;
case C_CONTAINER: case C_CONTAINER:
con = container_destroy(con); con = container_destroy(con);
con = container_reap_empty(con);
arrange_windows(con, -1, -1); arrange_windows(con, -1, -1);
break; break;
case C_VIEW: case C_VIEW:

View File

@ -58,7 +58,7 @@ struct sway_container *container_create(enum sway_container_type type) {
return c; return c;
} }
struct sway_container *container_destroy(struct sway_container *cont) { static struct sway_container *_container_destroy(struct sway_container *cont) {
if (cont == NULL) { if (cont == NULL) {
return NULL; return NULL;
} }
@ -89,6 +89,11 @@ struct sway_container *container_destroy(struct sway_container *cont) {
return parent; 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_container *container_output_create(
struct sway_output *sway_output) { struct sway_output *sway_output) {
struct wlr_box size; struct wlr_box size;