clm: allow matching clients by id
This commit is contained in:
parent
acec4c7f09
commit
c75b6ef66e
3 changed files with 29 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ macro_rules! fixed_root_criterion {
|
|||
};
|
||||
}
|
||||
|
||||
pub mod clmm_id;
|
||||
pub mod clmm_is_xwayland;
|
||||
pub mod clmm_pid;
|
||||
pub mod clmm_sandboxed;
|
||||
|
|
|
|||
19
src/criteria/clm/clm_matchers/clmm_id.rs
Normal file
19
src/criteria/clm/clm_matchers/clmm_id.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
use {
|
||||
crate::{
|
||||
client::{Client, ClientId},
|
||||
criteria::{RootMatcherMap, clm::RootMatchers, crit_graph::CritRootCriterion},
|
||||
},
|
||||
std::rc::Rc,
|
||||
};
|
||||
|
||||
pub struct ClmMatchId(pub ClientId);
|
||||
|
||||
impl CritRootCriterion<Rc<Client>> for ClmMatchId {
|
||||
fn matches(&self, data: &Rc<Client>) -> bool {
|
||||
data.id == self.0
|
||||
}
|
||||
|
||||
fn nodes(roots: &RootMatchers) -> Option<&RootMatcherMap<Rc<Client>, Self>> {
|
||||
Some(&roots.id)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue