#[non_exhaustive]pub enum WindowCriterion<'a> {
Show 30 variants
Matcher(WindowMatcher),
Not(&'a WindowCriterion<'a>),
Types(WindowType),
All(&'a [WindowCriterion<'a>]),
Any(&'a [WindowCriterion<'a>]),
Exactly(usize, &'a [WindowCriterion<'a>]),
Client(&'a ClientCriterion<'a>),
Title(&'a str),
TitleRegex(&'a str),
AppId(&'a str),
AppIdRegex(&'a str),
Floating,
Visible,
Urgent,
Focus(Seat),
Fullscreen,
JustMapped,
Tag(&'a str),
TagRegex(&'a str),
XClass(&'a str),
XClassRegex(&'a str),
XInstance(&'a str),
XInstanceRegex(&'a str),
XRole(&'a str),
XRoleRegex(&'a str),
Workspace(Workspace),
WorkspaceName(&'a str),
WorkspaceNameRegex(&'a str),
ContentTypes(ContentType),
IsWorkspaceContainer,
}Expand description
A criterion for matching a window.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Matcher(WindowMatcher)
Matches if the contained matcher matches.
Not(&'a WindowCriterion<'a>)
Matches if the contained criterion does not match.
Types(WindowType)
Matches if the window has one of the types.
All(&'a [WindowCriterion<'a>])
Matches if all of the contained criteria match.
Any(&'a [WindowCriterion<'a>])
Matches if any of the contained criteria match.
Exactly(usize, &'a [WindowCriterion<'a>])
Matches if an exact number of the contained criteria match.
Client(&'a ClientCriterion<'a>)
Matches if the window’s client matches the client criterion.
Title(&'a str)
Matches the title of the window verbatim.
TitleRegex(&'a str)
Matches the title of the window with a regular expression.
AppId(&'a str)
Matches the app-id of the window verbatim.
AppIdRegex(&'a str)
Matches the app-id of the window with a regular expression.
Floating
Matches if the window is floating.
Visible
Matches if the window is visible.
Urgent
Matches if the window has the urgency flag set.
Focus(Seat)
Matches if the window has the keyboard focus of the seat.
Fullscreen
Matches if the window is fullscreen.
JustMapped
Matches if the window has/hasn’t just been mapped.
This is true for one iteration of the compositor’s main loop immediately after the window has been mapped.
Tag(&'a str)
Matches the toplevel-tag of the window verbatim.
TagRegex(&'a str)
Matches the toplevel-tag of the window with a regular expression.
XClass(&'a str)
Matches the X class of the window verbatim.
XClassRegex(&'a str)
Matches the X class of the window with a regular expression.
XInstance(&'a str)
Matches the X instance of the window verbatim.
XInstanceRegex(&'a str)
Matches the X instance of the window with a regular expression.
XRole(&'a str)
Matches the X role of the window verbatim.
XRoleRegex(&'a str)
Matches the X role of the window with a regular expression.
Workspace(Workspace)
Matches the workspace the window.
WorkspaceName(&'a str)
Matches the workspace name of the window verbatim.
WorkspaceNameRegex(&'a str)
Matches the workspace name of the window with a regular expression.
ContentTypes(ContentType)
Matches if the window has one of the content types.
IsWorkspaceContainer
Matches if the window is the root container of a workspace.
Implementations§
Source§impl WindowCriterion<'_>
impl WindowCriterion<'_>
Sourcepub fn to_matcher(self) -> WindowMatcher
pub fn to_matcher(self) -> WindowMatcher
Converts the criterion to a matcher.
Sourcepub fn bind<F: FnMut(MatchedWindow) + 'static>(self, cb: F)
pub fn bind<F: FnMut(MatchedWindow) + 'static>(self, cb: F)
Binds a function to execute when the criterion matches a window.
This leaks the matcher.
Sourcepub fn set_auto_focus(self, auto_focus: bool)
pub fn set_auto_focus(self, auto_focus: bool)
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.
Sourcepub fn set_initial_tile_state(self, tile_state: TileState)
pub fn set_initial_tile_state(self, tile_state: TileState)
Sets whether newly mapped windows that match this matcher are mapped tiling or floating.
If multiple such window matchers match a window, the used tile state is unspecified.
This leaks the matcher.
Sourcepub fn set_initial_floating_size(self, width: i32, height: i32)
pub fn set_initial_floating_size(self, width: i32, height: i32)
Sets the size that matched windows have when they are initially mapped floating.
This has no effect on windows that are initially mapped tiled, even if they later become floating.
If multiple such window matchers match a window, the used size is unspecified.
This leaks the matcher.
Sourcepub fn set_initial_floating_position(self, x: i32, y: i32)
pub fn set_initial_floating_position(self, x: i32, y: i32)
Sets the position that matched windows have when they are initially mapped floating.
The position is relative to the top-left corner of the output that the window is mapped on and refers to the top-left corner of the window itself, excluding any decorations. It is clamped so that the window remains at least partially visible on that output.
This has no effect on windows that are initially mapped tiled, even if they later become floating.
If multiple such window matchers match a window, the used position is unspecified.
This leaks the matcher.