mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 07:52:50 -05:00
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user