Skip to main content

WindowCriterion

Enum WindowCriterion 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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<'_>

Source

pub fn to_matcher(self) -> WindowMatcher

Converts the criterion to a matcher.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl<'a> Clone for WindowCriterion<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for WindowCriterion<'a>

Source§

impl<'a> Debug for WindowCriterion<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Eq for WindowCriterion<'a>

Source§

impl<'a> Hash for WindowCriterion<'a>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a> PartialEq for WindowCriterion<'a>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for WindowCriterion<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for WindowCriterion<'a>

§

impl<'a> RefUnwindSafe for WindowCriterion<'a>

§

impl<'a> Send for WindowCriterion<'a>

§

impl<'a> Sync for WindowCriterion<'a>

§

impl<'a> Unpin for WindowCriterion<'a>

§

impl<'a> UnsafeUnpin for WindowCriterion<'a>

§

impl<'a> UnwindSafe for WindowCriterion<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.