Skip to content

Commit

Permalink
workspace: reap empty parents when adding tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronan Pigott committed Apr 26, 2021
1 parent fd36289 commit c121699
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 c121699

Please sign in to comment.