Fix notification mappings missing .desktop

This commit is contained in:
Charles Gagnon
2025-02-11 00:35:55 -05:00
parent f162ac0624
commit 7ae5e86e12
2 changed files with 7 additions and 6 deletions

View File

@@ -1681,7 +1681,7 @@ export const TaskbarAppIcon = GObject.registerClass(
let panelSize =
this.dtpPanel.geom[this.dtpPanel.checkIfVertical() ? 'w' : 'h']
let fontSize = Math.round(
Math.max(10, 0.3 * panelSize) / Utils.getScaleFactor(),
Math.max(11, 0.3 * panelSize) / Utils.getScaleFactor(),
)
let size = Math.round(fontSize * 1.3)
let style = `

View File

@@ -25,7 +25,7 @@ import { EventEmitter } from 'resource:///org/gnome/shell/misc/signals.js'
import * as Utils from './utils.js'
const tracker = Shell.WindowTracker.get_default()
const knownCorrespondances = {
const knownIdMappings = {
'org.gnome.Evolution': [/^org\.gnome\.[eE]volution([.-].+)?$/g],
}
@@ -80,16 +80,17 @@ export const NotificationsMonitor = class extends EventEmitter {
// depending of the notification source, some app id end
// with ".desktop" and some don't ¯\_(ツ)_/¯
appId = appId.replace('.desktop', '')
appId = `${appId}.desktop`
// some app have different source app id, deamon and such,
// but it maps to a desktop app so match those here
if (!ignoreMapping && !knownCorrespondances[appId])
if (!ignoreMapping && !knownIdMappings[appId])
appId =
Object.keys(knownCorrespondances).find((k) =>
knownCorrespondances[k].some((regex) => appId.match(regex)),
Object.keys(knownIdMappings).find((k) =>
knownIdMappings[k].some((regex) => appId.match(regex)),
) || appId
appId = `${appId}.desktop`
this._state[appId] = this._state[appId] || {}
this._mergeState(appId, state)