aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/move.c
diff options
context:
space:
mode:
authorLibravatar Tudor Brindus <me@tbrindus.ca>2020-09-26 16:27:30 -0400
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2020-10-04 21:02:35 -0400
commit392d4808c3012ff978fa5eeb41f0757b3993dcd1 (patch)
tree2a52de8ab919f860a9794f77920978c76d00f5b9 /sway/commands/move.c
parentdesktop/render: show indicators for top-level split (diff)
downloadsway-392d4808c3012ff978fa5eeb41f0757b3993dcd1.tar.gz
sway-392d4808c3012ff978fa5eeb41f0757b3993dcd1.tar.zst
sway-392d4808c3012ff978fa5eeb41f0757b3993dcd1.zip
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.
Diffstat (limited to 'sway/commands/move.c')
-rw-r--r--sway/commands/move.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c
index c1d1fade..959e5bfb 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -311,9 +311,10 @@ static bool container_move_in_direction(struct sway_container *container,
311 311
312 // If container is in a split container by itself, move out of the split 312 // If container is in a split container by itself, move out of the split
313 if (container->parent) { 313 if (container->parent) {
314 struct sway_container *old_parent = container->parent;
314 struct sway_container *new_parent = 315 struct sway_container *new_parent =
315 container_flatten(container->parent); 316 container_flatten(container->parent);
316 if (new_parent != container->parent) { 317 if (new_parent != old_parent) {
317 return true; 318 return true;
318 } 319 }
319 } 320 }