Revert: "tiling: Move window into sibling group, if orientation matches "

This commit is contained in:
Victoria Brekenfeld 2023-06-09 17:14:01 +02:00
parent 9444eed4c3
commit 19c0fad00c

View file

@ -632,52 +632,7 @@ impl TilingLayout {
| (Orientation::Vertical, Direction::Up)
| (Orientation::Vertical, Direction::Down)
) {
if len == 2 {
if let Some(sibling) = tree
.children_ids(&parent)
.unwrap()
.find(|id| *id != &child_id)
.cloned()
{
let sibling_data = tree.get(&sibling).unwrap().data();
if sibling_data.is_group() {
let sibling_orientation = sibling_data.orientation();
if matches!(
(sibling_orientation, direction),
(Orientation::Vertical, Direction::Right)
| (Orientation::Vertical, Direction::Left)
| (Orientation::Horizontal, Direction::Up)
| (Orientation::Horizontal, Direction::Down)
) && child_id == node_id
{
// ..lets move into our sibling group instead
let idx =
if direction == Direction::Left || direction == Direction::Up {
0
} else {
sibling_data.len()
};
tree.move_node(&node_id, MoveBehavior::ToParent(&sibling))
.unwrap();
tree.make_nth_sibling(&node_id, idx).unwrap();
tree.get_mut(&sibling).unwrap().data_mut().add_window(idx);
tree.get_mut(&og_parent)
.unwrap()
.data_mut()
.remove_window(og_idx);
let blocker =
TilingLayout::update_positions(&output, &mut tree, self.gaps);
queue.push_tree(tree, blocker);
return None;
}
}
}
}
// or create a new group with our parent (cleanup will remove any one-child-groups afterwards)
// ...create a new group with our parent (cleanup will remove any one-child-groups afterwards)
TilingLayout::new_group(
&mut tree,
&parent,