From 6995c2fa9f1a0b6cf673d233a0bd9f615c3093ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 8 Jul 2021 19:23:38 +0200 Subject: [PATCH] shellInfo: Don't destroy source on undo Destroying the source from an action callback will result in the notification being destroyed twice: - source.destroy() destroys all its notifications - a notification destroys itself after an action was activated This results in unwanted log spam when attempting to dispose the notification for a second time. There is actually no good reason for destroying the source explicitly, as sources already self-destruct with their last notification. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4457 Part-of: --- js/ui/overview.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/js/ui/overview.js b/js/ui/overview.js index 529779ea8..c71b11389 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -25,16 +25,6 @@ var OVERVIEW_ACTIVATION_TIMEOUT = 0.5; var ShellInfo = class { constructor() { this._source = null; - this._undoCallback = null; - } - - _onUndoClicked() { - if (this._undoCallback) - this._undoCallback(); - this._undoCallback = null; - - if (this._source) - this._source.destroy(); } setMessage(text, options) { @@ -64,9 +54,8 @@ var ShellInfo = class { notification.update(text, null, { clear: true }); } - this._undoCallback = undoCallback; if (undoCallback) - notification.addAction(_("Undo"), this._onUndoClicked.bind(this)); + notification.addAction(_('Undo'), () => undoCallback()); this._source.showNotification(notification); }