aboutsummaryrefslogtreecommitdiff
path: root/niri-ipc/src
diff options
context:
space:
mode:
authorDuncan Overbruck <mail@duncano.de>2025-05-10 20:18:49 +0200
committerIvan Molodetskikh <yalterz@gmail.com>2025-05-10 12:14:41 -0700
commita8259b4ceae521311f5152980287ff88d0b984e7 (patch)
tree8f261b5f60242496831a21dddb6a2f32fb454afd /niri-ipc/src
parent9d3d7cb0e973827e5fcaa5d312a05695564a44c0 (diff)
downloadniri-a8259b4ceae521311f5152980287ff88d0b984e7.tar.gz
niri-a8259b4ceae521311f5152980287ff88d0b984e7.tar.bz2
niri-a8259b4ceae521311f5152980287ff88d0b984e7.zip
add WindowUrgencyChanged ipc event
Diffstat (limited to 'niri-ipc/src')
-rw-r--r--niri-ipc/src/lib.rs9
-rw-r--r--niri-ipc/src/state.rs8
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