Fix focused_window not returning None if no window is focused

This commit is contained in:
Ottatop 2024-03-04 19:34:00 -06:00
parent a83d8275fa
commit d02c138414

View file

@ -18,16 +18,20 @@ impl State {
// TODO: see if the below is necessary // TODO: see if the below is necessary
// output.with_state(|state| state.focus_stack.stack.retain(|win| win.alive())); // output.with_state(|state| state.focus_stack.stack.retain(|win| win.alive()));
output.with_state(|state| { output
state .with_state(|state| {
.focus_stack state.focus_stack.focused.then(|| {
.stack state
.iter() .focus_stack
.rev() .stack
.filter(|win| win.is_on_active_tag()) .iter()
.find(|win| !win.is_x11_override_redirect()) .rev()
.cloned() .filter(|win| win.is_on_active_tag())
}) .find(|win| !win.is_x11_override_redirect())
.cloned()
})
})
.flatten()
} }
/// Update the keyboard focus. /// Update the keyboard focus.