From ed5b0f91203ecacda4f2e19039ada6a7f5062d8a Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Thu, 31 Oct 2024 16:58:44 -0700 Subject: [PATCH] fix(wm): avoid slurping on stack -> stack ops This commit ensures that when both the origin and target containers are stacks during a stack operation, the "slurping" stack extension behaviour introduced in cfb0c7f2ce760b9d27232b8293e35638f049c03a will not be applied. fix #1085 --- komorebi/src/window_manager.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/komorebi/src/window_manager.rs b/komorebi/src/window_manager.rs index c5d28a3d..6f6fb2a5 100644 --- a/komorebi/src/window_manager.rs +++ b/komorebi/src/window_manager.rs @@ -2020,8 +2020,16 @@ impl WindowManager { new_idx }; + let mut target_container_is_stack = false; + + if let Some(container) = workspace.containers().get(adjusted_new_index) { + if container.windows().len() > 1 { + target_container_is_stack = true; + } + } + if let Some(current) = workspace.focused_container() { - if current.windows().len() > 1 { + if current.windows().len() > 1 && !target_container_is_stack { workspace.focus_container(adjusted_new_index); workspace.move_window_to_container(current_container_idx)?; } else {