From 4d1ce0de41b61ba4ed3b6747095e23d6203f6da5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 27 Sep 2021 15:40:05 +0200 Subject: [PATCH] notificationDaemon: Fix sound-file support When commit 25bfe99ed53b5b7 replaced the thin libcanberra wrapper with the (then) new MetaSoundPlayer API, it missed that the latter expects files as GFile instead of a file path. Part-of: --- js/ui/notificationDaemon.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index 69137b1b2..954ce8068 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -229,11 +229,16 @@ var FdoNotificationDaemon = class FdoNotificationDaemon { if (!gicon) gicon = this._fallbackIconForNotificationData(hints); - notification.update(summary, body, { gicon, - bannerMarkup: true, - clear: true, - soundFile: hints['sound-file'], - soundName: hints['sound-name'] }); + const soundFile = 'sound-file' in hints + ? Gio.File.new_for_path(hints['sound-file']) : null; + + notification.update(summary, body, { + gicon, + bannerMarkup: true, + clear: true, + soundFile, + soundName: hints['sound-name'], + }); let hasDefaultAction = false;