aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/move.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-06 11:53:55 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-06 11:53:55 +1000
commit01117db6d9c50572646f9c49e50e02473129c7d4 (patch)
tree62683197c721d9e47fe720092da9e7853a281331 /sway/commands/move.c
parentMerge pull request #2582 from ascent12/func (diff)
downloadsway-01117db6d9c50572646f9c49e50e02473129c7d4.tar.gz
sway-01117db6d9c50572646f9c49e50e02473129c7d4.tar.zst
sway-01117db6d9c50572646f9c49e50e02473129c7d4.zip
Fix crash when moving view across outputs
It was incorrectly determining that the container being moved and the destination had the same parent, which resulted in tree corruption. Both parents can be NULL but the containers may belong to different workspaces. To reproduce, create layout H[V[view] view] in one workspace then move a view left or right from another output into that workspace.
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 7b503624..59f1cf78 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -117,7 +117,8 @@ static void container_move_to_container_from_direction(
117 struct sway_container *container, struct sway_container *destination, 117 struct sway_container *container, struct sway_container *destination,
118 enum movement_direction move_dir) { 118 enum movement_direction move_dir) {
119 if (destination->view) { 119 if (destination->view) {
120 if (destination->parent == container->parent) { 120 if (destination->parent == container->parent &&
121 destination->workspace == container->workspace) {
121 wlr_log(WLR_DEBUG, "Swapping siblings"); 122 wlr_log(WLR_DEBUG, "Swapping siblings");
122 list_t *siblings = container_get_siblings(container); 123 list_t *siblings = container_get_siblings(container);
123 int container_index = list_find(siblings, container); 124 int container_index = list_find(siblings, container);