1
0
Fork 0
forked from wry/wry

config: add toplevel-tag window criteria

This commit is contained in:
Julian Orth 2025-05-01 17:31:42 +02:00
parent 5f1268cada
commit 6d3d4dcabb
15 changed files with 106 additions and 8 deletions

View file

@ -123,4 +123,5 @@ pub enum WindowCriterionIpc {
pub enum WindowCriterionStringField {
Title,
AppId,
Tag,
}

View file

@ -1663,6 +1663,8 @@ impl ConfigClient {
WindowCriterion::Focus(seat) => WindowCriterionIpc::SeatFocus(seat),
WindowCriterion::Fullscreen => WindowCriterionIpc::Fullscreen,
WindowCriterion::JustMapped => WindowCriterionIpc::JustMapped,
WindowCriterion::Tag(t) => string!(t, Tag, false),
WindowCriterion::TagRegex(t) => string!(t, Tag, true),
};
let res = self.send_with_response(&ClientMessage::CreateWindowMatcher { criterion });
get_response!(

View file

@ -260,6 +260,10 @@ pub enum WindowCriterion<'a> {
/// This is true for one iteration of the compositor's main loop immediately after the
/// window has been mapped.
JustMapped,
/// Matches the toplevel-tag of the window verbatim.
Tag(&'a str),
/// Matches the toplevel-tag of the window with a regular expression.
TagRegex(&'a str),
}
impl WindowCriterion<'_> {