Skip to content

Commit

Permalink
workspace: reap empty parents when adding tiles
Browse files Browse the repository at this point in the history
(cherry picked from commit c121699)
  • Loading branch information
Ronan Pigott authored and emersion committed Jun 24, 2021
1 parent 14522df commit eb0724c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sway/tree/workspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit eb0724c

Please sign in to comment.