mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2024-12-26 21:58:10 +01:00
Fix focused_window
not returning None
if no window is focused
This commit is contained in:
parent
a83d8275fa
commit
d02c138414
1 changed files with 14 additions and 10 deletions
24
src/focus.rs
24
src/focus.rs
|
@ -18,16 +18,20 @@ impl State {
|
|||
// 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
|
||||
.iter()
|
||||
.rev()
|
||||
.filter(|win| win.is_on_active_tag())
|
||||
.find(|win| !win.is_x11_override_redirect())
|
||||
.cloned()
|
||||
})
|
||||
output
|
||||
.with_state(|state| {
|
||||
state.focus_stack.focused.then(|| {
|
||||
state
|
||||
.focus_stack
|
||||
.stack
|
||||
.iter()
|
||||
.rev()
|
||||
.filter(|win| win.is_on_active_tag())
|
||||
.find(|win| !win.is_x11_override_redirect())
|
||||
.cloned()
|
||||
})
|
||||
})
|
||||
.flatten()
|
||||
}
|
||||
|
||||
/// Update the keyboard focus.
|
||||
|
|
Loading…
Reference in a new issue