From e5a7dfbdb0320dcca6aa7d60778e7a5781739c99 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Thu, 8 Aug 2024 20:49:43 +0200 Subject: [PATCH] layout/tiling: enumerate all children before swapping --- src/shell/layout/tiling/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/shell/layout/tiling/mod.rs b/src/shell/layout/tiling/mod.rs index bbb5ffb8..ff32a950 100644 --- a/src/shell/layout/tiling/mod.rs +++ b/src/shell/layout/tiling/mod.rs @@ -895,6 +895,12 @@ impl TilingLayout { .into_iter() .map(|child_id| (other_desc.node.clone(), child_id.clone())) .collect::>(); + let mut other_children = other_node + .children() + .into_iter() + .map(|child_id| (this_desc.node.clone(), child_id.clone())) + .collect::>(); + while !this_children.is_empty() { for (parent_id, child_id) in std::mem::take(&mut this_children) { let new_children = this_tree @@ -935,12 +941,6 @@ impl TilingLayout { } } - let other_node = other_tree.get_mut(&other_desc.node).ok()?; - let mut other_children = other_node - .children() - .into_iter() - .map(|child_id| (this_desc.node.clone(), child_id.clone())) - .collect::>(); while !other_children.is_empty() { for (parent_id, child_id) in std::mem::take(&mut other_children) { let new_children = other_tree