Struct State

Source
pub struct State<H: Handle> {
Show 18 fields pub screens: Vec<Screen<H>>, pub windows: Vec<Window<H>>, pub workspaces: Vec<Workspace>, pub focus_manager: FocusManager<H>, pub layout_manager: LayoutManager, pub mode: Mode<H>, pub active_scratchpads: HashMap<ScratchPadName, VecDeque<ChildID>>, pub actions: VecDeque<DisplayAction<H>>, pub tags: Tags, pub scratchpads: Vec<ScratchPad>, pub layout_definitions: Vec<Layout>, pub mousekey: Vec<String>, pub default_width: i32, pub default_height: i32, pub disable_tile_drag: bool, pub reposition_cursor_on_resize: bool, pub insert_behavior: InsertBehavior, pub single_window_border: bool,
}

Fields§

§screens: Vec<Screen<H>>§windows: Vec<Window<H>>§workspaces: Vec<Workspace>§focus_manager: FocusManager<H>§layout_manager: LayoutManager§mode: Mode<H>§active_scratchpads: HashMap<ScratchPadName, VecDeque<ChildID>>§actions: VecDeque<DisplayAction<H>>§tags: Tags§scratchpads: Vec<ScratchPad>§layout_definitions: Vec<Layout>§mousekey: Vec<String>§default_width: i32§default_height: i32§disable_tile_drag: bool§reposition_cursor_on_resize: bool§insert_behavior: InsertBehavior§single_window_border: bool

Implementations§

Source§

impl<H: Handle> State<H>

Source

pub fn handle_window_focus(&mut self, handle: &WindowHandle<H>)

Focuses a window based upon the FocusBehaviour

Source

pub fn focus_window(&mut self, handle: &WindowHandle<H>)

Focuses the given window.

Source

pub fn focus_workspace(&mut self, workspace: &Workspace)

Focuses the given workspace.

Source

pub fn focus_tag(&mut self, tag: &TagId)

Focuses the given tag.

Source

pub fn focus_workspace_with_point(&mut self, x: i32, y: i32)

Focuses the workspace containing a given point.

Source

pub fn focus_window_with_point(&mut self, x: i32, y: i32)

Focuses the window containing a given point.

Source

pub fn validate_focus_at(&mut self, handle: &WindowHandle<H>)

Validates that the given window is focused.

Source§

impl<H: Handle> State<H>

Source

pub fn goto_tag_handler(&mut self, tag_id: TagId) -> Option<bool>

goto_tag_handler is called in response to various Commands. it updates the focus manager and focuses tag_id

Returns Some(true) if changes need to be rendered.

Source§

impl<H: Handle> State<H>

Source

pub fn mouse_combo_handler( &mut self, modmask: &ModMask, button: Button, handle: WindowHandle<H>, x: i32, y: i32, ) -> bool

mouse_combo_handler is called when the display server sends DisplayEvent::MouseCombo(modmask, button, handle, x, y)

Returns true if changes need to be rendered.

Source§

impl<H: Handle> State<H>

Source

pub fn sort_windows(&mut self)

Sorts the windows and puts them in order of importance.

Source

pub fn handle_single_border(&mut self, border_width: i32)

Removes border if there is a single visible window. Only will run if single_window_border is set to false in the configuration file.

Source

pub fn move_to_top(&mut self, handle: &WindowHandle<H>) -> Option<()>

Moves handle in front of all other windows of the same order of importance. See sort_windows() for the order of importance.

Source

pub fn update_static(&mut self)

Source

pub fn restore_state(&mut self, old_state: &Self)

Apply saved state to a running manager.

Trait Implementations§

Source§

impl<H: Debug + Handle> Debug for State<H>

Source§

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

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

impl<'de, H: Handle> Deserialize<'de> for State<H>

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<H: Handle> From<&State<H>> for ManagerState

Source§

fn from(state: &State<H>) -> Self

Converts to this type from the input type.
Source§

impl<H: Handle> Serialize for State<H>

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

Auto Trait Implementations§

§

impl<H> Freeze for State<H>
where H: Freeze,

§

impl<H> RefUnwindSafe for State<H>
where H: RefUnwindSafe,

§

impl<H> Send for State<H>

§

impl<H> Sync for State<H>
where H: Sync,

§

impl<H> Unpin for State<H>
where H: Unpin,

§

impl<H> UnwindSafe for State<H>
where H: UnwindSafe,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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