mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-07 19:59:14 -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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user