messageList: Use default signal handler for closing notifications
And change the `close` signal on `Message` to run the default handler last, which allows other signal handers to stop the signal emission chain. This change shouldn't have much effect on existing code but will be needed for by-source notification grouping. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3429>
This commit is contained in:
@ -408,7 +408,9 @@ export const Message = GObject.registerClass({
|
||||
GLib.DateTime),
|
||||
},
|
||||
Signals: {
|
||||
'close': {},
|
||||
'close': {
|
||||
flags: GObject.SignalFlags.RUN_LAST,
|
||||
},
|
||||
'expanded': {},
|
||||
'unexpanded': {},
|
||||
},
|
||||
@ -664,11 +666,6 @@ class NotificationMessage extends Message {
|
||||
|
||||
this.notification = notification;
|
||||
|
||||
this.connect('close', () => {
|
||||
this._closed = true;
|
||||
if (this.notification)
|
||||
this.notification.destroy(MessageTray.NotificationDestroyedReason.DISMISSED);
|
||||
});
|
||||
notification.connectObject(
|
||||
'action-added', (_, action) => this._addAction(action),
|
||||
'action-removed', (_, action) => this._removeAction(action),
|
||||
@ -700,6 +697,11 @@ class NotificationMessage extends Message {
|
||||
});
|
||||
}
|
||||
|
||||
on_close() {
|
||||
this._closed = true;
|
||||
this.notification?.destroy(MessageTray.NotificationDestroyedReason.DISMISSED);
|
||||
}
|
||||
|
||||
vfunc_clicked() {
|
||||
this.notification.activate();
|
||||
}
|
||||
|
Reference in New Issue
Block a user