Enum niri_ipc::Event

source ·
pub enum Event {
    WorkspacesChanged {
        workspaces: Vec<Workspace>,
    },
    WorkspaceActivated {
        id: u64,
        focused: bool,
    },
    WorkspaceActiveWindowChanged {
        workspace_id: u64,
        active_window_id: Option<u64>,
    },
    WindowsChanged {
        windows: Vec<Window>,
    },
    WindowOpenedOrChanged {
        window: Window,
    },
    WindowClosed {
        id: u64,
    },
    WindowFocusChanged {
        id: Option<u64>,
    },
    KeyboardLayoutsChanged {
        keyboard_layouts: KeyboardLayouts,
    },
    KeyboardLayoutSwitched {
        idx: u8,
    },
}
Expand description

A compositor event.

Variants§

§

WorkspacesChanged

The workspace configuration has changed.

Fields

§workspaces: Vec<Workspace>

The new workspace configuration.

This configuration completely replaces the previous configuration. I.e. if any workspaces are missing from here, then they were deleted.

§

WorkspaceActivated

A workspace was activated on an output.

This doesn’t always mean the workspace became focused, just that it’s now the active workspace on its output. All other workspaces on the same output become inactive.

Fields

§id: u64

Id of the newly active workspace.

§focused: bool

Whether this workspace also became focused.

If true, this is now the single focused workspace. All other workspaces are no longer focused, but they may remain active on their respective outputs.

§

WorkspaceActiveWindowChanged

An active window changed on a workspace.

Fields

§workspace_id: u64

Id of the workspace on which the active window changed.

§active_window_id: Option<u64>

Id of the new active window, if any.

§

WindowsChanged

The window configuration has changed.

Fields

§windows: Vec<Window>

The new window configuration.

This configuration completely replaces the previous configuration. I.e. if any windows are missing from here, then they were closed.

§

WindowOpenedOrChanged

A new toplevel window was opened, or an existing toplevel window changed.

Fields

§window: Window

The new or updated window.

If the window is focused, all other windows are no longer focused.

§

WindowClosed

A toplevel window was closed.

Fields

§id: u64

Id of the removed window.

§

WindowFocusChanged

Window focus changed.

All other windows are no longer focused.

Fields

§id: Option<u64>

Id of the newly focused window, or None if no window is now focused.

§

KeyboardLayoutsChanged

The configured keyboard layouts have changed.

Fields

§keyboard_layouts: KeyboardLayouts

The new keyboard layout configuration.

§

KeyboardLayoutSwitched

The keyboard layout switched.

Fields

§idx: u8

Index of the newly active layout.

Trait Implementations§

source§

impl Clone for Event

source§

fn clone(&self) -> Event

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 Event

source§

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

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

impl<'de> Deserialize<'de> for Event

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 Serialize for Event

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 Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

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 T)

🔬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>,