messageTray: Add notification-removed
signal to Source
This allows us to drop the `destroy` signal handler for each notification in MessageTray. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3173>
This commit is contained in:
parent
b1d2a5bac8
commit
ec5bbfe319
@ -633,6 +633,7 @@ export const Source = GObject.registerClass({
|
|||||||
Signals: {
|
Signals: {
|
||||||
'destroy': {param_types: [GObject.TYPE_UINT]},
|
'destroy': {param_types: [GObject.TYPE_UINT]},
|
||||||
'notification-added': {param_types: [Notification.$gtype]},
|
'notification-added': {param_types: [Notification.$gtype]},
|
||||||
|
'notification-removed': {param_types: [Notification.$gtype]},
|
||||||
'notification-show': {param_types: [Notification.$gtype]},
|
'notification-show': {param_types: [Notification.$gtype]},
|
||||||
},
|
},
|
||||||
}, class Source extends MessageList.Source {
|
}, class Source extends MessageList.Source {
|
||||||
@ -687,6 +688,7 @@ export const Source = GObject.registerClass({
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
this.notifications.splice(index, 1);
|
this.notifications.splice(index, 1);
|
||||||
|
this.emit('notification-removed', notification);
|
||||||
this.countUpdated();
|
this.countUpdated();
|
||||||
|
|
||||||
if (this.notifications.length === 0)
|
if (this.notifications.length === 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user