aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-27 13:46:01 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-28 22:41:04 +1000
commitdebb8e85b2808e4b5e8ff79a702ffc48efc36389 (patch)
tree8b10ef61c063626fed9f2018e3f22088c405484c /sway/tree/container.c
parentSend floating container to scratchpad when a child is focused (diff)
downloadsway-debb8e85b2808e4b5e8ff79a702ffc48efc36389.tar.gz
sway-debb8e85b2808e4b5e8ff79a702ffc48efc36389.tar.zst
sway-debb8e85b2808e4b5e8ff79a702ffc48efc36389.zip
Fix crash when unfloating child of container into empty workspace
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 71babe5c..2332d81f 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -1030,10 +1030,13 @@ void container_set_floating(struct sway_container *container, bool enable) {
1030 if (container->scratchpad) { 1030 if (container->scratchpad) {
1031 scratchpad_remove_container(container); 1031 scratchpad_remove_container(container);
1032 } 1032 }
1033 struct sway_container *sibling =
1034 seat_get_focus_inactive_tiling(seat, workspace);
1035 container_remove_child(container); 1033 container_remove_child(container);
1036 container_add_sibling(sibling, container); 1034 struct sway_container *reference =
1035 seat_get_focus_inactive_tiling(seat, workspace);
1036 if (reference->type == C_VIEW) {
1037 reference = reference->parent;
1038 }
1039 container_add_child(reference, container);
1037 container->width = container->parent->width; 1040 container->width = container->parent->width;
1038 container->height = container->parent->height; 1041 container->height = container->parent->height;
1039 if (container->type == C_VIEW) { 1042 if (container->type == C_VIEW) {