Struct Seat

Source
pub struct Seat(pub u64);
Expand description

A seat.

Tuple Fields§

§0: u64

Implementations§

Source§

impl Seat

Source

pub const INVALID: Self

Source

pub fn is_invalid(self) -> bool

Returns whether the seat is invalid.

Source

pub fn use_hardware_cursor(self, use_hardware_cursor: bool)

Sets whether this seat’s cursor uses the hardware cursor if available.

Only one seat at a time can use the hardware cursor. Setting this to true for a seat automatically unsets it for all other seats.

By default, the first created seat uses the hardware cursor.

Source

pub fn set_cursor_size(self, size: i32)

Sets the size of the cursor theme.

Default: 16.

Source

pub fn bind<T: Into<ModifiedKeySym>, F: FnMut() + 'static>( self, mod_sym: T, f: F, )

Creates a compositor-wide hotkey.

The closure is invoked when the user presses the last key of the modified keysym. Note that the keysym is calculated without modifiers applied. To perform an action when SHIFT+k is pressed, use SHIFT | SYM_k not SHIFT | SYM_K.

CapsLock and NumLock are ignored during modifier evaluation. Therefore, bindings containing these modifiers will never be invoked.

Source

pub fn bind_masked<T: Into<ModifiedKeySym>, F: FnMut() + 'static>( self, mod_mask: Modifiers, mod_sym: T, f: F, )

Creates a compositor-wide hotkey while ignoring some modifiers.

This is similar to bind except that only the masked modifiers are considered.

For example, if this function is invoked with mod_mask = Modifiers::NONE and mod_sym = SYM_XF86AudioRaiseVolume, then the callback will be invoked whenever SYM_XF86AudioRaiseVolume is pressed. Even if the user is simultaneously holding the shift key which would otherwise prevent the callback from taking effect.

For example, if this function is invoked with mod_mask = CTRL | SHIFT and mod_sym = CTRL | SYM_x, then the callback will be invoked whenever the user presses ctrl+x without pressing the shift key. Even if the user is simultaneously holding the alt key.

If mod_sym contains any modifiers, then these modifiers are automatically added to the mask. The synthetic RELEASE modifier is always added to the mask.

Source

pub fn latch<F: FnOnce() + 'static>(self, f: F)

Registers a callback to be executed when the currently pressed key is released.

This should only be called in callbacks for key-press binds.

The callback will be executed once when the key is released regardless of any modifiers.

Source

pub fn unbind<T: Into<ModifiedKeySym>>(self, mod_sym: T)

Unbinds a hotkey.

Source

pub fn focus(self, direction: Direction)

Moves the keyboard focus of the seat in the specified direction.

Source

pub fn move_(self, direction: Direction)

Moves the focused window in the specified direction.

Source

pub fn set_keymap(self, keymap: Keymap)

Sets the keymap of the seat.

Source

pub fn repeat_rate(self) -> (i32, i32)

Returns the repeat rate of the seat.

The returned tuple is (rate, delay) where rate is the number of times keys repeat per second and delay is the time after the button press after which keys start repeating.

Source

pub fn set_repeat_rate(self, rate: i32, delay: i32)

Sets the repeat rate of the seat.

Source

pub fn mono(self) -> bool

Returns whether the parent-container of the currently focused window is in mono-mode.

Source

pub fn set_mono(self, mono: bool)

Sets whether the parent-container of the currently focused window is in mono-mode.

Source

pub fn toggle_mono(self)

Toggles whether the parent-container of the currently focused window is in mono-mode.

Source

pub fn split(self) -> Axis

Returns the split axis of the parent-container of the currently focused window.

Source

pub fn set_split(self, axis: Axis)

Sets the split axis of the parent-container of the currently focused window.

Source

pub fn toggle_split(self)

Toggles the split axis of the parent-container of the currently focused window.

Source

pub fn input_devices(self) -> Vec<InputDevice>

Returns the input devices assigned to this seat.

Source

pub fn create_split(self, axis: Axis)

Creates a new container with the specified split in place of the currently focused window.

Source

pub fn focus_parent(self)

Focuses the parent node of the currently focused window.

Source

pub fn close(self)

Requests the currently focused window to be closed.

Source

pub fn get_floating(self) -> bool

Returns whether the currently focused window is floating.

Source

pub fn set_floating(self, floating: bool)

Sets whether the currently focused window is floating.

Source

pub fn toggle_floating(self)

Toggles whether the currently focused window is floating.

You can do the same by double-clicking on the header.

Source

pub fn get_workspace(self) -> Workspace

Returns the workspace that is currently active on the output that contains the seat’s cursor.

If no such workspace exists, exists returns false for the returned workspace.

Source

pub fn show_workspace(self, workspace: Workspace)

Shows the workspace and sets the keyboard focus of the seat to that workspace.

If the workspace doesn’t currently exist, it is created on the output that contains the seat’s cursor.

Source

pub fn set_workspace(self, workspace: Workspace)

Moves the currently focused window to the workspace.

Source

pub fn toggle_fullscreen(self)

Toggles whether the currently focused window is fullscreen.

Source

pub fn fullscreen(self) -> bool

Returns whether the currently focused window is fullscreen.

Source

pub fn set_fullscreen(self, fullscreen: bool)

Sets whether the currently focused window is fullscreen.

Source

pub fn disable_pointer_constraint(self)

Disables the currently active pointer constraint on this seat.

Source

pub fn move_to_output(self, connector: Connector)

Moves the currently focused workspace to another output.

Source

pub fn set_forward(self, forward: bool)

Set whether the current key event is forwarded to the focused client.

This only has an effect if called from a keyboard shortcut.

By default, release events are forwarded and press events are consumed. Note that consuming release events can cause clients to get stuck in the pressed state.

Source

pub fn forward(self)

This is a shorthand for set_forward(true).

Source

pub fn consume(self)

This is a shorthand for set_forward(false).

Source

pub fn set_focus_follows_mouse_mode(self, mode: FocusFollowsMouseMode)

Sets the focus-follows-mouse mode.

Source

pub fn set_window_management_enabled(self, enabled: bool)

Enables or disable window management mode.

In window management mode, floating windows can be moved by pressing the left mouse button and all windows can be resize by pressing the right mouse button.

Source

pub fn set_window_management_key<T: Into<ModifiedKeySym>>(self, mod_sym: T)

Sets a key that enables window management mode while pressed.

This is a shorthand for

self.bind(mod_sym, move || {
    self.set_window_management_enabled(true);
    self.forward();
    self.latch(move || {
        self.set_window_management_enabled(false);
    });
});

Trait Implementations§

Source§

impl Clone for Seat

Source§

fn clone(&self) -> Seat

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Seat

Source§

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

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

impl<'de> Deserialize<'de> for Seat

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for Seat

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 PartialEq for Seat

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Seat

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for Seat

Source§

impl Eq for Seat

Source§

impl StructuralPartialEq for Seat

Auto Trait Implementations§

§

impl Freeze for Seat

§

impl RefUnwindSafe for Seat

§

impl Send for Seat

§

impl Sync for Seat

§

impl Unpin for Seat

§

impl UnwindSafe for Seat

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,