From 9af81e44bc4f71cf94417bf8824edf5d287eee1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 20 Feb 2024 19:46:19 +0100 Subject: [PATCH] notificationDaemon: Fix auto-closing FDO notifications We auto-close FDO notifications when the sender leaves the bus, given that the protocol was created without persistency in mind and any action will become invalid. However that broke when moving the public-facing implementation into a separate service, as we now track the (always running) service instead of the original sender. Fix that by forwarding the sender to the internal implementation via a private hint, just like we already do for the PID. Part-of: --- js/dbusServices/notifications/notificationDaemon.js | 1 + js/ui/notificationDaemon.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/js/dbusServices/notifications/notificationDaemon.js b/js/dbusServices/notifications/notificationDaemon.js index 473b0c4c0..38ad9118f 100644 --- a/js/dbusServices/notifications/notificationDaemon.js +++ b/js/dbusServices/notifications/notificationDaemon.js @@ -101,6 +101,7 @@ export const NotificationDaemon = class extends ServiceImplementation { params[6] = { ...hints, 'x-shell-sender-pid': new GLib.Variant('u', pid), + 'x-shell-sender': new GLib.Variant('s', sender), }; try { diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index 4c6437a8c..d6aa3811c 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -161,7 +161,7 @@ class FdoNotificationDaemon { } this._notifications[id] = ndata; - let sender = invocation.get_sender(); + const sender = hints['x-shell-sender']; const pid = hints['x-shell-sender-pid']; let source = this._getSource(appName, pid, ndata, sender, null);