1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 07:52:50 -05:00

niri: handle window urgency event

fixes #1033
This commit is contained in:
bbedward
2025-12-15 12:16:43 -05:00
parent 306d7b2ce0
commit bafe1c5fee
2 changed files with 28 additions and 3 deletions

View File

@@ -304,6 +304,9 @@ Singleton {
case 'WorkspaceUrgencyChanged':
handleWorkspaceUrgencyChanged(event.WorkspaceUrgencyChanged);
break;
case 'WindowUrgencyChanged':
handleWindowUrgencyChanged(event.WindowUrgencyChanged);
break;
case 'ScreenshotCaptured':
handleScreenshotCaptured(event.ScreenshotCaptured);
break;
@@ -571,6 +574,23 @@ Singleton {
windowUrgentChanged();
}
function handleWindowUrgencyChanged(data) {
const windowIndex = windows.findIndex(w => w.id === data.id);
if (windowIndex < 0)
return;
const updatedWindows = [...windows];
const updatedWindow = {};
for (let prop in updatedWindows[windowIndex]) {
updatedWindow[prop] = updatedWindows[windowIndex][prop];
}
updatedWindow.is_urgent = data.urgent;
updatedWindows[windowIndex] = updatedWindow;
windows = updatedWindows;
windowUrgentChanged();
}
function handleScreenshotCaptured(data) {
if (!data.path)
return;