fix: only activate the active window of the stack on activation

This commit is contained in:
Ashley Wulber 2025-07-21 15:15:03 -04:00 committed by Victoria Brekenfeld
parent 4cf612dd22
commit f2d6f70e13

View file

@ -352,10 +352,16 @@ impl CosmicStack {
} }
FocusDirection::In if swap.is_none() => { FocusDirection::In if swap.is_none() => {
if !p.group_focused.swap(false, Ordering::SeqCst) { if !p.group_focused.swap(false, Ordering::SeqCst) {
p.windows.lock().unwrap().iter().for_each(|w| { p.windows
w.set_activated(true); .lock()
w.send_configure(); .unwrap()
}); .iter()
.enumerate()
.for_each(|(i, w)| {
w.set_activated(p.active.load(Ordering::SeqCst) == i);
w.send_configure();
});
(true, true) (true, true)
} else { } else {
(false, false) (false, false)
@ -1162,7 +1168,11 @@ impl SpaceElement for CosmicStack {
.lock() .lock()
.unwrap() .unwrap()
.iter() .iter()
.for_each(|w| SpaceElement::set_activate(w, activated)) .enumerate()
.for_each(|(i, w)| {
w.set_activated(activated && p.active.load(Ordering::SeqCst) == i);
w.send_configure();
});
} }
p.activated.swap(activated, Ordering::SeqCst) != activated p.activated.swap(activated, Ordering::SeqCst) != activated
}); });