[gnome-shell/gnome-42] extensionSystem: Check if mode is supported when loading



commit d9af82ca4e683b8df372486eaf81691d2d267f70
Author: Alessandro Bono <alessandro bono369 gmail com>
Date:   Thu Jul 14 15:37:42 2022 +0200

    extensionSystem: Check if mode is supported when loading
    
    Don't try to initialize and then enable an extension if it is not supported
    in the current mode. Otherwise the extension will not be initialized, and the
    initial ERROR state is not cleared. Once it is in ERROR state we can't enable
    it anymore when we switch mode. Instead, leave the extension in INITIALIZED
    state, so that it will be initialized when appropriate. This happens for
    extensions that support the unlock-dialog mode but not the user mode.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2378>
    (cherry picked from commit d01d38e1e903819312b18b5b57c7f1504f8c6632)

 js/ui/extensionSystem.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
index 663d7154cb..3cc0048819 100644
--- a/js/ui/extensionSystem.js
+++ b/js/ui/extensionSystem.js
@@ -374,7 +374,8 @@ var ExtensionManager = class {
             this.logExtensionError(extension.uuid, new Error(
                 'A different version was loaded previously. You need to log out for changes to take 
effect.'));
         } else {
-            let enabled = this._enabledExtensions.includes(extension.uuid);
+            let enabled = this._enabledExtensions.includes(extension.uuid) &&
+                          this._extensionSupportsSessionMode(extension.uuid);
             if (enabled) {
                 if (!this._callExtensionInit(extension.uuid))
                     return;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]