Add support for WindowAttentionSource notifications

gh-2162
This commit is contained in:
Charles Gagnon
2025-02-23 19:55:01 -05:00
parent fcbfb4d4d5
commit 1cdf56d4eb

View File

@@ -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
)
}),
})
}