From 1e882ba8dca09643f66c8a63f1f650257e1ae0b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 25 Feb 2024 21:22:22 +0100 Subject: [PATCH] dbusServices/extensions: Override destroy() method Some extensions try to destroy the provided dialog, so they can instead show the preferences in an alternative way. Unfortunately that is undetectable from the Extensions service, which still thinks the dialog is open, and will therefore block other prefs dialogs. Try to steer extensions away from that anti-pattern (or at the very least switch to `close()` which doesn't break) by overriding the window's destroy() method and show an extension error instead. Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7435 Part-of: --- js/dbusServices/extensions/extensionPrefsDialog.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/dbusServices/extensions/extensionPrefsDialog.js b/js/dbusServices/extensions/extensionPrefsDialog.js index 334640d5e..9e3ea57ee 100644 --- a/js/dbusServices/extensions/extensionPrefsDialog.js +++ b/js/dbusServices/extensions/extensionPrefsDialog.js @@ -58,6 +58,11 @@ export const ExtensionPrefsDialog = GObject.registerClass({ }); } + destroy() { + this._showErrorPage( + new Error('destroy() breaks tracking open dialogs, use close() if you must')); + } + _showErrorPage(e) { while (this.visible_page) this.remove(this.visible_page);