config: add auto-focus window rule
This commit is contained in:
parent
51e752992f
commit
b1ca98b488
12 changed files with 114 additions and 10 deletions
|
|
@ -296,6 +296,16 @@ impl WindowCriterion<'_> {
|
|||
pub fn bind<F: FnMut(MatchedWindow) + 'static>(self, cb: F) {
|
||||
self.to_matcher().bind(cb);
|
||||
}
|
||||
|
||||
/// Sets whether newly mapped windows that match this criterion get the keyboard focus.
|
||||
///
|
||||
/// If a window matches any criterion for which this is false, the window will not be
|
||||
/// automatically focused.
|
||||
///
|
||||
/// This leaks the matcher.
|
||||
pub fn set_auto_focus(self, auto_focus: bool) {
|
||||
self.to_matcher().set_auto_focus(auto_focus);
|
||||
}
|
||||
}
|
||||
|
||||
impl WindowMatcher {
|
||||
|
|
@ -312,6 +322,14 @@ impl WindowMatcher {
|
|||
pub fn bind<F: FnMut(MatchedWindow) + 'static>(self, cb: F) {
|
||||
get!().set_window_matcher_handler(self, cb);
|
||||
}
|
||||
|
||||
/// Sets whether newly mapped windows that match this matcher get the keyboard focus.
|
||||
///
|
||||
/// If a window matches any matcher for which this is false, the window will not be
|
||||
/// automatically focused.
|
||||
pub fn set_auto_focus(self, auto_focus: bool) {
|
||||
get!().set_window_matcher_auto_focus(self, auto_focus);
|
||||
}
|
||||
}
|
||||
|
||||
impl MatchedWindow {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue