aboutsummaryrefslogtreecommitdiff
path: root/niri-ipc/src
diff options
context:
space:
mode:
Diffstat (limited to 'niri-ipc/src')
-rw-r--r--niri-ipc/src/lib.rs9
-rw-r--r--niri-ipc/src/state.rs7
2 files changed, 16 insertions, 0 deletions
diff --git a/niri-ipc/src/lib.rs b/niri-ipc/src/lib.rs
index 75d9a543..fcb2d1ff 100644
--- a/niri-ipc/src/lib.rs
+++ b/niri-ipc/src/lib.rs
@@ -1150,6 +1150,8 @@ pub struct Workspace {
///
/// Can be `None` if no outputs are currently connected.
pub output: Option<String>,
+ /// Whether the workspace currently has an urgent window in its output.
+ pub is_urgent: bool,
/// Whether the workspace is currently active on its output.
///
/// Every output has one active workspace, the one that is currently visible on that output.
@@ -1224,6 +1226,13 @@ pub enum Event {
/// workspaces are missing from here, then they were deleted.
workspaces: Vec<Workspace>,
},
+ /// The workspace urgency changed.
+ WorkspaceUrgencyChanged {
+ /// Id of the workspace.
+ id: u64,
+ /// Whether this workspace has an urgent window.
+ urgent: bool,
+ },
/// A workspace was activated on an output.
///
/// This doesn't always mean the workspace became focused, just that it's now the active
diff --git a/niri-ipc/src/state.rs b/niri-ipc/src/state.rs
index 0689104d..9edeeabf 100644
--- a/niri-ipc/src/state.rs
+++ b/niri-ipc/src/state.rs
@@ -103,6 +103,13 @@ impl EventStreamStatePart for WorkspacesState {
Event::WorkspacesChanged { workspaces } => {
self.workspaces = workspaces.into_iter().map(|ws| (ws.id, ws)).collect();
}
+ Event::WorkspaceUrgencyChanged { id, urgent } => {
+ for ws in self.workspaces.values_mut() {
+ if ws.id == id {
+ ws.is_urgent = urgent;
+ }
+ }
+ }
Event::WorkspaceActivated { id, focused } => {
let ws = self.workspaces.get(&id);
let ws = ws.expect("activated workspace was missing from the map");