summaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/container.c')
-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) {
1030 struct sway_container *workspace = container_parent(container, C_WORKSPACE); 1030 struct sway_container *workspace = container_parent(container, C_WORKSPACE);
1031 1031
1032 if (enable) { 1032 if (enable) {
1033 container_remove_child(container); 1033 struct sway_container *old_parent = container_remove_child(container);
1034 container_add_child(workspace->sway_workspace->floating, container); 1034 container_add_child(workspace->sway_workspace->floating, container);
1035 container_init_floating(container); 1035 container_init_floating(container);
1036 if (container->type == C_VIEW) { 1036 if (container->type == C_VIEW) {
1037 view_set_tiled(container->sway_view, false); 1037 view_set_tiled(container->sway_view, false);
1038 } 1038 }
1039 container_reap_empty(old_parent);
1039 } else { 1040 } else {
1040 // Returning to tiled 1041 // Returning to tiled
1041 if (container->scratchpad) { 1042 if (container->scratchpad) {