From ec5bbfe319ca78b92c76ff565fbe53ee35cd9669 Mon Sep 17 00:00:00 2001 From: Julian Sparber Date: Wed, 14 Feb 2024 19:16:00 +0100 Subject: [PATCH] messageTray: Add `notification-removed` signal to `Source` This allows us to drop the `destroy` signal handler for each notification in MessageTray. Part-of: --- js/ui/messageTray.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 0d03e2541..a861219a4 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -633,6 +633,7 @@ export const Source = GObject.registerClass({ Signals: { 'destroy': {param_types: [GObject.TYPE_UINT]}, 'notification-added': {param_types: [Notification.$gtype]}, + 'notification-removed': {param_types: [Notification.$gtype]}, 'notification-show': {param_types: [Notification.$gtype]}, }, }, class Source extends MessageList.Source { @@ -687,6 +688,7 @@ export const Source = GObject.registerClass({ return; this.notifications.splice(index, 1); + this.emit('notification-removed', notification); this.countUpdated(); if (this.notifications.length === 0)