aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-08-17 13:37:39 +0100
committerGitHub <noreply@github.com>2018-08-17 13:37:39 +0100
commit754bbd03c0948cb91a65960a371c7e07c55818af (patch)
tree498e03974e32b23b0b19a0996d899ab8bfdd4e63 /sway/tree
parent782d0e087e7d345d8218a96d13f2a4844765e8ed (diff)
parent6a26b499a42412ed453706a436e2f8649a358954 (diff)
Merge pull request #2471 from RyanDwyer/reap-when-floating
Attempt to reap old tiling parent when floating a container
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/container.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index eb06edc2..db780270 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -1030,12 +1030,13 @@ void container_set_floating(struct sway_container *container, bool enable) {
struct sway_container *workspace = container_parent(container, C_WORKSPACE);
if (enable) {
- container_remove_child(container);
+ struct sway_container *old_parent = container_remove_child(container);
container_add_child(workspace->sway_workspace->floating, container);
container_init_floating(container);
if (container->type == C_VIEW) {
view_set_tiled(container->sway_view, false);
}
+ container_reap_empty(old_parent);
} else {
// Returning to tiled
if (container->scratchpad) {