1
0
Fork 0
forked from wry/wry

clm: allow matching clients by id

This commit is contained in:
Julian Orth 2026-03-07 11:47:57 +01:00
parent acec4c7f09
commit c75b6ef66e
3 changed files with 29 additions and 0 deletions

View file

@ -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;

View 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)
}
}