1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-27 15:02:50 -05:00

Handle urgent workspaces

This commit is contained in:
bbedward
2025-10-03 18:17:24 -04:00
parent ddc88fd360
commit 44449e26a0
2 changed files with 53 additions and 2 deletions

View File

@@ -23,6 +23,8 @@ Singleton {
property var windows: []
signal windowUrgentChanged()
property bool inOverview: false
property int currentKeyboardLayoutIndex: 0
@@ -189,6 +191,9 @@ Singleton {
case 'KeyboardLayoutSwitched':
handleKeyboardLayoutSwitched(event.KeyboardLayoutSwitched);
break;
case 'WorkspaceUrgencyChanged':
handleWorkspaceUrgencyChanged(event.WorkspaceUrgencyChanged);
break;
}
}
@@ -373,6 +378,22 @@ Singleton {
currentKeyboardLayoutIndex = data.idx
}
function handleWorkspaceUrgencyChanged(data) {
const ws = root.workspaces[data.id]
if (!ws) {
return
}
ws.is_urgent = data.urgent
const idx = allWorkspaces.findIndex(w => w.id === data.id)
if (idx >= 0) {
allWorkspaces[idx].is_urgent = data.urgent
}
windowUrgentChanged()
}
Process {
id: validateProcess
command: ["niri", "validate"]