mirror of
https://github.com/swaywm/sway.git
synced 2025-01-31 05:06:45 +00:00
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:
parent
215787e8b2
commit
90529532a7
|
@ -860,9 +860,15 @@ void container_set_floating(struct sway_container *container, bool enable) {
|
||||||
if (reference) {
|
if (reference) {
|
||||||
if (reference->view) {
|
if (reference->view) {
|
||||||
container_add_sibling(reference, container, 1);
|
container_add_sibling(reference, container, 1);
|
||||||
|
} else {
|
||||||
|
struct sway_container *sibling =
|
||||||
|
seat_get_focus_inactive_view(seat, &reference->node);
|
||||||
|
if (sibling) {
|
||||||
|
container_add_sibling(sibling, container, 1);
|
||||||
} else {
|
} else {
|
||||||
container_add_child(reference, container);
|
container_add_child(reference, container);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
container->pending.width = reference->pending.width;
|
container->pending.width = reference->pending.width;
|
||||||
container->pending.height = reference->pending.height;
|
container->pending.height = reference->pending.height;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue