diff options
Diffstat (limited to 'niri-ipc/src')
| -rw-r--r-- | niri-ipc/src/lib.rs | 9 | ||||
| -rw-r--r-- | niri-ipc/src/state.rs | 8 |
2 files changed, 17 insertions, 0 deletions
diff --git a/niri-ipc/src/lib.rs b/niri-ipc/src/lib.rs index 86388f16..6d7ea92d 100644 --- a/niri-ipc/src/lib.rs +++ b/niri-ipc/src/lib.rs @@ -1129,6 +1129,8 @@ pub struct Window { /// /// If the window isn't floating then it is in the tiling layout. pub is_floating: bool, + /// Whether this window requests your attention. + pub is_urgent: bool, } /// Output configuration change result. @@ -1298,6 +1300,13 @@ pub enum Event { /// Id of the newly focused window, or `None` if no window is now focused. id: Option<u64>, }, + /// Window urgency changed. + WindowUrgencyChanged { + /// Id of the window. + id: u64, + /// The new urgency state of the window. + urgent: bool, + }, /// The configured keyboard layouts have changed. KeyboardLayoutsChanged { /// The new keyboard layout configuration. diff --git a/niri-ipc/src/state.rs b/niri-ipc/src/state.rs index 9edeeabf..ef03321f 100644 --- a/niri-ipc/src/state.rs +++ b/niri-ipc/src/state.rs @@ -181,6 +181,14 @@ impl EventStreamStatePart for WindowsState { win.is_focused = Some(win.id) == id; } } + Event::WindowUrgencyChanged { id, urgent } => { + for win in self.windows.values_mut() { + if win.id == id { + win.is_urgent = urgent; + break; + } + } + } event => return Some(event), } None |
