From 1cdf56d4ebe82cafb42f538339b4aaa2e89f5b86 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Sun, 23 Feb 2025 19:55:01 -0500 Subject: [PATCH] Add support for WindowAttentionSource notifications gh-2162 --- src/notificationsMonitor.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/notificationsMonitor.js b/src/notificationsMonitor.js index 15312bc..44c5402 100644 --- a/src/notificationsMonitor.js +++ b/src/notificationsMonitor.js @@ -148,15 +148,19 @@ export const NotificationsMonitor = class extends EventEmitter { } _checkNotifications() { - let getSourceId = (source) => source?._appId || source?.app?.id + let getSourceId = (source) => + source?._appId || source?.app?.id || source?.policy?.id let addSource = (tray, source) => { let appId = getSourceId(source) let updateTray = () => { this._updateState(appId, { trayCount: source.count, // always source.unseenCount might be less annoying - trayUrgent: !!source.notifications.find( - (n) => n.urgency > MessageTray.Urgency.NORMAL, - ), + trayUrgent: !!source.notifications.find((n) => { + return ( + n.urgency > MessageTray.Urgency.NORMAL || + source.constructor.name == 'WindowAttentionSource' // private type from gnome-shell + ) + }), }) }