diff options
author | Ronan Pigott <rpigott@berkeley.edu> | 2021-04-18 15:15:43 -0700 |
---|---|---|
committer | Ronan Pigott <rpigott@berkeley.edu> | 2021-04-26 13:14:24 -0700 |
commit | c12169953abd393506367b949a63de5928ad9518 (patch) | |
tree | 317441764cc7f2f04c5240fc72e8cf102505778d | |
parent | fd36289faa86e92583f014af358f5eca99a3d4aa (diff) |
workspace: reap empty parents when adding tiles
-rw-r--r-- | sway/tree/workspace.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index 4e735064..c0da9c93 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c @@ -794,7 +794,11 @@ void workspace_detach(struct sway_workspace *workspace) { struct sway_container *workspace_add_tiling(struct sway_workspace *workspace, struct sway_container *con) { if (con->pending.workspace) { + struct sway_container *old_parent = con->pending.parent; container_detach(con); + if (old_parent) { + container_reap_empty(old_parent); + } } if (config->default_layout != L_NONE) { con = container_split(con, config->default_layout); |