config: add keyboard-focus window criteria
This commit is contained in:
parent
eb172e9d8c
commit
91c948b219
15 changed files with 95 additions and 4 deletions
|
|
@ -20,6 +20,7 @@ macro_rules! fixed_root_criterion {
|
|||
pub mod tlmm_client;
|
||||
pub mod tlmm_floating;
|
||||
pub mod tlmm_kind;
|
||||
pub mod tlmm_seat_focus;
|
||||
pub mod tlmm_string;
|
||||
pub mod tlmm_urgent;
|
||||
pub mod tlmm_visible;
|
||||
|
|
|
|||
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