container: restore next to sibling after floating

Follow-up to a558866f42

If seat_get_focus_inactive_tiling returns a non-view container, restore
the floated container next to the previous sibling inside of the
container instead of appending to the end. This matches i3 behavior.
This commit is contained in:
siikamiika 2021-10-09 16:21:18 +03:00
parent 215787e8b2
commit 90529532a7

View file

@ -861,7 +861,13 @@ void container_set_floating(struct sway_container *container, bool enable) {
if (reference->view) {
container_add_sibling(reference, container, 1);
} else {
container_add_child(reference, container);
struct sway_container *sibling =
seat_get_focus_inactive_view(seat, &reference->node);
if (sibling) {
container_add_sibling(sibling, container, 1);
} else {
container_add_child(reference, container);
}
}
container->pending.width = reference->pending.width;
container->pending.height = reference->pending.height;