From 6b4eb83af570a676a61ad2b52fca1146e1b9d61c Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Mon, 11 Sep 2023 21:10:46 +0200 Subject: [PATCH] stack: Fix missing re-enter on add --- src/shell/element/stack.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shell/element/stack.rs b/src/shell/element/stack.rs index 80ba66a6..782584af 100644 --- a/src/shell/element/stack.rs +++ b/src/shell/element/stack.rs @@ -180,7 +180,12 @@ impl CosmicStack { window.send_configure(); if let Some(idx) = idx { p.windows.lock().unwrap().insert(idx, window); - p.active.store(idx, Ordering::SeqCst); + let old_idx = p.active.swap(idx, Ordering::SeqCst); + if old_idx == idx { + p.reenter.store(true, Ordering::SeqCst); + p.previous_keyboard.store(old_idx, Ordering::SeqCst); + p.previous_pointer.store(old_idx, Ordering::SeqCst); + } } else { let mut windows = p.windows.lock().unwrap(); windows.push(window);