From 809e3d8d217dcdc212b8a3078fbe8d646164f15e Mon Sep 17 00:00:00 2001 From: Aram Drevekenin Date: Mon, 3 Apr 2023 18:54:37 +0200 Subject: [PATCH] fix(layout): pane focus in stack (#2344) --- zellij-server/src/panes/tiled_panes/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zellij-server/src/panes/tiled_panes/mod.rs b/zellij-server/src/panes/tiled_panes/mod.rs index 4cc7279d7..08a633b0a 100644 --- a/zellij-server/src/panes/tiled_panes/mod.rs +++ b/zellij-server/src/panes/tiled_panes/mod.rs @@ -1434,6 +1434,10 @@ impl TiledPanes { .iter() .map(|(cid, pid)| (*cid, *pid)) .collect(); + let clients_need_to_be_moved = active_panes.iter().any(|(_c_id, p_id)| *p_id == pane_id); + if !clients_need_to_be_moved { + return; + } // find the most recently active pane let mut next_active_pane_candidates: Vec<(&PaneId, &Box)> = self @@ -1456,9 +1460,7 @@ impl TiledPanes { .map(|p| p.current_geom().is_stacked) .unwrap_or(false) { - let _ = StackedPanes::new_from_btreemap(&mut self.panes, &self.panes_to_hide) - .expand_pane(&next_active_pane_id); - self.reapply_pane_frames(); + self.expand_pane_in_stack(next_active_pane_id); } for (client_id, active_pane_id) in active_panes { if active_pane_id == pane_id {