1
0
Fork 0
forked from wry/wry

config: allow matching on client tag

This commit is contained in:
Julian Orth 2026-02-27 20:53:09 +01:00
parent 596909cd25
commit 8b19315f50
13 changed files with 76 additions and 8 deletions

View file

@ -12,7 +12,7 @@ use {
clmm_sandboxed::ClmMatchSandboxed,
clmm_string::{
ClmMatchComm, ClmMatchExe, ClmMatchSandboxAppId, ClmMatchSandboxEngine,
ClmMatchSandboxInstanceId,
ClmMatchSandboxInstanceId, ClmMatchTag,
},
clmm_uid::ClmMatchUid,
},
@ -61,6 +61,7 @@ pub struct RootMatchers {
pid: ClmRootMatcherMap<ClmMatchPid>,
comm: ClmRootMatcherMap<ClmMatchComm>,
exe: ClmRootMatcherMap<ClmMatchExe>,
tag: ClmRootMatcherMap<ClmMatchTag>,
}
impl RootMatchers {
@ -72,6 +73,7 @@ impl RootMatchers {
self.pid.clear();
self.comm.clear();
self.exe.clear();
self.tag.clear();
}
}
@ -181,6 +183,7 @@ impl ClMatcherManager {
unconditional!(pid);
unconditional!(comm);
unconditional!(exe);
unconditional!(tag);
fixed!(sandboxed);
fixed!(is_xwayland);
self.constant[true].handle(data);
@ -222,6 +225,10 @@ impl ClMatcherManager {
pub fn exe(&self, string: CritLiteralOrRegex) -> Rc<ClmUpstreamNode> {
self.root(ClmMatchExe::new(string))
}
pub fn tag(&self, string: CritLiteralOrRegex) -> Rc<ClmUpstreamNode> {
self.root(ClmMatchTag::new(string))
}
}
impl CritTarget for Rc<Client> {