config: add keyboard-focus window criteria
This commit is contained in:
parent
eb172e9d8c
commit
91c948b219
15 changed files with 95 additions and 4 deletions
28
src/criteria/tlm/tlm_matchers/tlmm_seat_focus.rs
Normal file
28
src/criteria/tlm/tlm_matchers/tlmm_seat_focus.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
use crate::{
|
||||
criteria::{
|
||||
crit_graph::CritRootCriterion,
|
||||
tlm::{RootMatchers, TlmRootMatcherMap},
|
||||
},
|
||||
ifs::wl_seat::SeatId,
|
||||
tree::ToplevelData,
|
||||
};
|
||||
|
||||
pub struct TlmMatchSeatFocus {
|
||||
id: SeatId,
|
||||
}
|
||||
|
||||
impl TlmMatchSeatFocus {
|
||||
pub fn new(id: SeatId) -> TlmMatchSeatFocus {
|
||||
Self { id }
|
||||
}
|
||||
}
|
||||
|
||||
impl CritRootCriterion<ToplevelData> for TlmMatchSeatFocus {
|
||||
fn matches(&self, data: &ToplevelData) -> bool {
|
||||
data.seat_foci.contains(&self.id)
|
||||
}
|
||||
|
||||
fn nodes(roots: &RootMatchers) -> Option<&TlmRootMatcherMap<Self>> {
|
||||
Some(&roots.seat_foci)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue