diff options
author | msizanoen1 <msizanoen@qtmlabs.xyz> | 2023-04-15 15:55:47 +0700 |
---|---|---|
committer | Marge Bot <marge-bot@gnome.org> | 2023-04-17 19:40:45 +0000 |
commit | cde7d44a28688cd925bac45ebfa2bb0e7dd46860 (patch) | |
tree | 321f262943d612b6cd6b501d4346405f38c452a1 | |
parent | 15048c1fcbf63e5e7f6f1651130208a0313fc93c (diff) | |
download | gnome-shell-cde7d44a28688cd925bac45ebfa2bb0e7dd46860.tar.gz |
messageTray: Don't set _notificationRemoved if destroyed notification is queued
When the user clears all notifications from the notification menu UI, it's
possible for a queued notification to be destroyed after the currently displayed
notification. The removal of the currently displayed notification is not
processed until the notification menu is closed (due to `this._bannerBlocked`).
By then, it's possible that `_notificationRemoved` has already been overwritten
when `_onNotificationDestroy` is invoked with another (queued) notification.
This eventually results in a notification banner that cannot be removed by the
user as the notification object needed to do so has already been destroyed.
Fix this by only assigning to `_notificationRemoved` if `this._notification ==
notification`.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2736>
-rw-r--r-- | js/ui/messageTray.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index e001f2202..1edd932f6 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -1006,9 +1006,8 @@ var MessageTray = GObject.registerClass({ } _onNotificationDestroy(notification) { - this._notificationRemoved = this._notification === notification; - - if (this._notificationRemoved) { + if (this._notification === notification) { + this._notificationRemoved = true; if (this._notificationState === State.SHOWN || this._notificationState === State.SHOWING) { this._updateNotificationTimeout(0); |