1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-08 04:09:15 -04:00

notifications: honor freedesktop suppress-sound hint (#2440)

Senders that play their own audio for a notification can set the
standard org.freedesktop.Notifications "suppress-sound" boolean hint
to ask the server not to double up. NotificationService skipped its
sound only as a side effect of the dedup early-return (when an
identically-keyed popup was still visible), so transient notifications
double-sounded while lingering ones didn't — nondeterministic. Read
notif.hints["suppress-sound"] and gate the AudioService call on it.
This commit is contained in:
Josh Symonds
2026-05-18 06:40:50 -07:00
committed by GitHub
parent 90ea136379
commit 9bd68d44a1
+5 -1
View File
@@ -656,7 +656,11 @@ Singleton {
}
}
if (SettingsData.soundsEnabled && SettingsData.soundNewNotification) {
// Honor the freedesktop "suppress-sound" hint: the sender
// plays its own audio for this notification and asks the
// server not to double up.
const suppressSound = !!(notif.hints && notif.hints["suppress-sound"]);
if (SettingsData.soundsEnabled && SettingsData.soundNewNotification && !suppressSound) {
if (policy.urgency === NotificationUrgency.Critical) {
AudioService.playCriticalNotificationSound();
} else {