diff options
author | Ronan Pigott <rpigott@berkeley.edu> | 2021-04-18 15:15:43 -0700 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-06-24 18:21:29 +0200 |
commit | d33f4957ce5dc610a1c20aff0052cef99570c671 (patch) | |
tree | a0554cfdccd710598d8a671a805d1d8d0dfbb169 | |
parent | desktop/render: Pass explicit clip box to render (diff) | |
download | sway-d33f4957ce5dc610a1c20aff0052cef99570c671.tar.gz sway-d33f4957ce5dc610a1c20aff0052cef99570c671.tar.zst sway-d33f4957ce5dc610a1c20aff0052cef99570c671.zip |
workspace: reap empty parents when adding tiles
(cherry picked from commit c12169953abd393506367b949a63de5928ad9518)
-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) { | |||
794 | struct sway_container *workspace_add_tiling(struct sway_workspace *workspace, | 794 | struct sway_container *workspace_add_tiling(struct sway_workspace *workspace, |
795 | struct sway_container *con) { | 795 | struct sway_container *con) { |
796 | if (con->pending.workspace) { | 796 | if (con->pending.workspace) { |
797 | struct sway_container *old_parent = con->pending.parent; | ||
797 | container_detach(con); | 798 | container_detach(con); |
799 | if (old_parent) { | ||
800 | container_reap_empty(old_parent); | ||
801 | } | ||
798 | } | 802 | } |
799 | if (config->default_layout != L_NONE) { | 803 | if (config->default_layout != L_NONE) { |
800 | con = container_split(con, config->default_layout); | 804 | con = container_split(con, config->default_layout); |