1
0
Fork 0
forked from wry/wry

config: add WM_WINDOW_ROLE window criteria

This commit is contained in:
Julian Orth 2025-05-03 14:01:39 +02:00
parent faa0b27ef8
commit 5ad6ca4dd3
14 changed files with 81 additions and 6 deletions

View file

@ -126,4 +126,5 @@ pub enum WindowCriterionStringField {
Tag,
XClass,
XInstance,
XRole,
}

View file

@ -1669,6 +1669,8 @@ impl ConfigClient {
WindowCriterion::XClassRegex(t) => string!(t, XClass, true),
WindowCriterion::XInstance(t) => string!(t, XInstance, false),
WindowCriterion::XInstanceRegex(t) => string!(t, XInstance, true),
WindowCriterion::XRole(t) => string!(t, XRole, false),
WindowCriterion::XRoleRegex(t) => string!(t, XRole, true),
};
let res = self.send_with_response(&ClientMessage::CreateWindowMatcher { criterion });
get_response!(

View file

@ -272,6 +272,10 @@ pub enum WindowCriterion<'a> {
XInstance(&'a str),
/// Matches the X instance of the window with a regular expression.
XInstanceRegex(&'a str),
/// Matches the X role of the window verbatim.
XRole(&'a str),
/// Matches the X role of the window with a regular expression.
XRoleRegex(&'a str),
}
impl WindowCriterion<'_> {