Skip to content

Commit f2d6f70

Browse files
wash2Drakulix
authored andcommitted
fix: only activate the active window of the stack on activation
1 parent 4cf612d commit f2d6f70

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/shell/element/stack.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,16 @@ impl CosmicStack {
352352
}
353353
FocusDirection::In if swap.is_none() => {
354354
if !p.group_focused.swap(false, Ordering::SeqCst) {
355-
p.windows.lock().unwrap().iter().for_each(|w| {
356-
w.set_activated(true);
357-
w.send_configure();
358-
});
355+
p.windows
356+
.lock()
357+
.unwrap()
358+
.iter()
359+
.enumerate()
360+
.for_each(|(i, w)| {
361+
w.set_activated(p.active.load(Ordering::SeqCst) == i);
362+
w.send_configure();
363+
});
364+
359365
(true, true)
360366
} else {
361367
(false, false)
@@ -1162,7 +1168,11 @@ impl SpaceElement for CosmicStack {
11621168
.lock()
11631169
.unwrap()
11641170
.iter()
1165-
.for_each(|w| SpaceElement::set_activate(w, activated))
1171+
.enumerate()
1172+
.for_each(|(i, w)| {
1173+
w.set_activated(activated && p.active.load(Ordering::SeqCst) == i);
1174+
w.send_configure();
1175+
});
11661176
}
11671177
p.activated.swap(activated, Ordering::SeqCst) != activated
11681178
});

0 commit comments

Comments
 (0)