config: add keyboard-focus window criteria
This commit is contained in:
parent
eb172e9d8c
commit
91c948b219
15 changed files with 95 additions and 4 deletions
|
|
@ -262,6 +262,7 @@ pub struct WindowMatch {
|
|||
pub floating: Option<bool>,
|
||||
pub visible: Option<bool>,
|
||||
pub urgent: Option<bool>,
|
||||
pub focused: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ impl Parser for WindowMatchParser<'_> {
|
|||
title,
|
||||
title_regex,
|
||||
),
|
||||
(app_id, app_id_regex, floating, visible, urgent),
|
||||
(app_id, app_id_regex, floating, visible, urgent, focused),
|
||||
) = ext.extract((
|
||||
(
|
||||
opt(str("name")),
|
||||
|
|
@ -75,6 +75,7 @@ impl Parser for WindowMatchParser<'_> {
|
|||
opt(bol("floating")),
|
||||
opt(bol("visible")),
|
||||
opt(bol("urgent")),
|
||||
opt(bol("focused")),
|
||||
),
|
||||
))?;
|
||||
let mut not = None;
|
||||
|
|
@ -123,6 +124,7 @@ impl Parser for WindowMatchParser<'_> {
|
|||
floating: floating.despan(),
|
||||
visible: visible.despan(),
|
||||
urgent: urgent.despan(),
|
||||
focused: focused.despan(),
|
||||
types,
|
||||
client,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -261,6 +261,14 @@ impl Rule for WindowRule {
|
|||
bool!(Floating, floating);
|
||||
bool!(Visible, visible);
|
||||
bool!(Urgent, urgent);
|
||||
if let Some(value) = match_.focused {
|
||||
let crit = WindowCriterion::Focus(state.persistent.seat);
|
||||
let matcher = match value {
|
||||
false => m(WindowCriterion::Not(&crit)),
|
||||
true => m(crit),
|
||||
};
|
||||
all.push(matcher);
|
||||
}
|
||||
Some(())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue