pub struct Seat(pub u64);
Expand description
A seat.
Tuple Fields§
§0: u64
Implementations§
Source§impl Seat
impl Seat
pub const INVALID: Self
Sourcepub fn is_invalid(self) -> bool
pub fn is_invalid(self) -> bool
Returns whether the seat is invalid.
Sourcepub fn use_hardware_cursor(self, use_hardware_cursor: bool)
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.
Sourcepub fn set_cursor_size(self, size: i32)
pub fn set_cursor_size(self, size: i32)
Sets the size of the cursor theme.
Default: 16.
Sourcepub fn bind<T: Into<ModifiedKeySym>, F: FnMut() + 'static>(
self,
mod_sym: T,
f: F,
)
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.
Sourcepub fn bind_masked<T: Into<ModifiedKeySym>, F: FnMut() + 'static>(
self,
mod_mask: Modifiers,
mod_sym: T,
f: F,
)
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.
Sourcepub fn latch<F: FnOnce() + 'static>(self, f: F)
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.
Sourcepub fn unbind<T: Into<ModifiedKeySym>>(self, mod_sym: T)
pub fn unbind<T: Into<ModifiedKeySym>>(self, mod_sym: T)
Unbinds a hotkey.
Sourcepub fn focus(self, direction: Direction)
pub fn focus(self, direction: Direction)
Moves the keyboard focus of the seat in the specified direction.
Sourcepub fn set_keymap(self, keymap: Keymap)
pub fn set_keymap(self, keymap: Keymap)
Sets the keymap of the seat.
Sourcepub fn repeat_rate(self) -> (i32, i32)
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.
Sourcepub fn set_repeat_rate(self, rate: i32, delay: i32)
pub fn set_repeat_rate(self, rate: i32, delay: i32)
Sets the repeat rate of the seat.
Sourcepub fn mono(self) -> bool
pub fn mono(self) -> bool
Returns whether the parent-container of the currently focused window is in mono-mode.
Sourcepub fn set_mono(self, mono: bool)
pub fn set_mono(self, mono: bool)
Sets whether the parent-container of the currently focused window is in mono-mode.
Sourcepub fn toggle_mono(self)
pub fn toggle_mono(self)
Toggles whether the parent-container of the currently focused window is in mono-mode.
Sourcepub fn split(self) -> Axis
pub fn split(self) -> Axis
Returns the split axis of the parent-container of the currently focused window.
Sourcepub fn set_split(self, axis: Axis)
pub fn set_split(self, axis: Axis)
Sets the split axis of the parent-container of the currently focused window.
Sourcepub fn toggle_split(self)
pub fn toggle_split(self)
Toggles the split axis of the parent-container of the currently focused window.
Sourcepub fn input_devices(self) -> Vec<InputDevice>
pub fn input_devices(self) -> Vec<InputDevice>
Returns the input devices assigned to this seat.
Sourcepub fn create_split(self, axis: Axis)
pub fn create_split(self, axis: Axis)
Creates a new container with the specified split in place of the currently focused window.
Sourcepub fn focus_parent(self)
pub fn focus_parent(self)
Focuses the parent node of the currently focused window.
Sourcepub fn get_floating(self) -> bool
pub fn get_floating(self) -> bool
Returns whether the currently focused window is floating.
Sourcepub fn set_floating(self, floating: bool)
pub fn set_floating(self, floating: bool)
Sets whether the currently focused window is floating.
Sourcepub fn toggle_floating(self)
pub fn toggle_floating(self)
Toggles whether the currently focused window is floating.
You can do the same by double-clicking on the header.
Sourcepub fn get_workspace(self) -> Workspace
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.
Sourcepub fn show_workspace(self, workspace: Workspace)
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.
Sourcepub fn set_workspace(self, workspace: Workspace)
pub fn set_workspace(self, workspace: Workspace)
Moves the currently focused window to the workspace.
Sourcepub fn toggle_fullscreen(self)
pub fn toggle_fullscreen(self)
Toggles whether the currently focused window is fullscreen.
Sourcepub fn fullscreen(self) -> bool
pub fn fullscreen(self) -> bool
Returns whether the currently focused window is fullscreen.
Sourcepub fn set_fullscreen(self, fullscreen: bool)
pub fn set_fullscreen(self, fullscreen: bool)
Sets whether the currently focused window is fullscreen.
Sourcepub fn disable_pointer_constraint(self)
pub fn disable_pointer_constraint(self)
Disables the currently active pointer constraint on this seat.
Sourcepub fn move_to_output(self, connector: Connector)
pub fn move_to_output(self, connector: Connector)
Moves the currently focused workspace to another output.
Sourcepub fn set_forward(self, forward: bool)
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.
Sourcepub fn set_focus_follows_mouse_mode(self, mode: FocusFollowsMouseMode)
pub fn set_focus_follows_mouse_mode(self, mode: FocusFollowsMouseMode)
Sets the focus-follows-mouse mode.
Sourcepub fn set_window_management_enabled(self, enabled: bool)
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.
Sourcepub fn set_window_management_key<T: Into<ModifiedKeySym>>(self, mod_sym: T)
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);
});
});