From a5b10f5d4a96db2ef222336f35d531d857726a93 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Tue, 12 Sep 2023 12:48:13 +0200 Subject: [PATCH] tiling: Fix swap-focus always selecting whole stacks --- src/shell/layout/tiling/mod.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/shell/layout/tiling/mod.rs b/src/shell/layout/tiling/mod.rs index 1b98a09b..2f734ef9 100644 --- a/src/shell/layout/tiling/mod.rs +++ b/src/shell/layout/tiling/mod.rs @@ -1948,7 +1948,10 @@ impl TilingLayout { })) } Data::Mapped { mapped, .. } => { - if mapped.is_stack() && desc.stack_window.is_none() { + if mapped.is_stack() + && desc.stack_window.is_none() + && replacement_id == &desc.node + { mapped.stack_ref().unwrap().focus_stack(); } FocusResult::Some(KeyboardFocusTarget::Element(mapped.clone())) @@ -2025,7 +2028,10 @@ impl TilingLayout { if mapped.is_stack() && swap_desc .as_ref() - .map(|desc| desc.stack_window.is_none()) + .map(|desc| { + desc.stack_window.is_none() + && &desc.node == node_id.unwrap() + }) .unwrap_or(false) { mapped.stack_ref().unwrap().focus_stack();