mirror of
https://github.com/NickHu/sway
synced 2024-11-16 19:49:56 +01:00
commands/move: fix single-split escaping on move
Prior to this commit, having a layout like T[app1 V[app2]], focusing app2, and then doing `move left` would result in T[app2 app1]. Now, the resulting layout is T[app1 app2], which matches i3 behavior. `container_flatten` updates `container->parent`, meaning that the existing check would never be true.
This commit is contained in:
parent
bc239b2f6b
commit
392d4808c3
1 changed files with 2 additions and 1 deletions
|
@ -311,9 +311,10 @@ static bool container_move_in_direction(struct sway_container *container,
|
||||||
|
|
||||||
// If container is in a split container by itself, move out of the split
|
// If container is in a split container by itself, move out of the split
|
||||||
if (container->parent) {
|
if (container->parent) {
|
||||||
|
struct sway_container *old_parent = container->parent;
|
||||||
struct sway_container *new_parent =
|
struct sway_container *new_parent =
|
||||||
container_flatten(container->parent);
|
container_flatten(container->parent);
|
||||||
if (new_parent != container->parent) {
|
if (new_parent != old_parent) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue