summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2019-08-06 04:46:57 -0400
committerFurkan Sahin <furkan-dev@proton.me>2019-08-06 04:46:57 -0400
commit4315c6c408bfa92a3693292c5d0fae68aa9598f4 (patch)
tree8a9842e434b28df1dd73718f7540707c95e04b08
parent56de165cb8db44ac06ad3cfc1fb02d17a8a0d4ad (diff)
container_replace: copy {width,height}_fraction
This copies the width and height fractions from the container to the container replacing it. Without setting these values, the container is treated as a new container and throws off the existing sizing. Since one container is replacing the other, it makes sense for the sizing to remain the same.
-rw-r--r--sway/tree/container.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index ef44c944..7068e166 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -1324,8 +1324,12 @@ void container_replace(struct sway_container *container,
root_scratchpad_remove_container(container);
}
if (container->parent || container->workspace) {
+ float width_fraction = container->width_fraction;
+ float height_fraction = container->height_fraction;
container_add_sibling(container, replacement, 1);
container_detach(container);
+ replacement->width_fraction = width_fraction;
+ replacement->height_fraction = height_fraction;
}
if (scratchpad) {
root_scratchpad_add_container(replacement, ws);