diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-17 16:23:37 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-17 16:23:37 +1000 |
commit | 6a26b499a42412ed453706a436e2f8649a358954 (patch) | |
tree | be0bfb25124eb00efce0910ecafa2d8bacbc6771 /sway | |
parent | Merge pull request #2465 from DonnieWest/master (diff) | |
download | sway-6a26b499a42412ed453706a436e2f8649a358954.tar.gz sway-6a26b499a42412ed453706a436e2f8649a358954.tar.zst sway-6a26b499a42412ed453706a436e2f8649a358954.zip |
Attempt to reap old tiling parent when floating a container
Diffstat (limited to 'sway')
-rw-r--r-- | sway/tree/container.c | 3 |
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) { |