Main.panel.statusArea.quickSettings._system is undefined

I am trying to port one of my extension from gnome shell v44 to v45.

I followed the documentation from Port Extensions to GNOME Shell 45 | GNOME JavaScript.

when I try this Main.panel.statusArea.quickSettings._system from LG I am getting the result but from extension it says undefined.

quickSettings

Do I need to wait for further release (v45.rc)

Any help on this is much appriciated.

The quick settings menu is now populated asynchronously (because bluetooth and networking are optional, and thus have to be imported dynamically).

That means that the extension system is now initialized before built-in quick settings items are added.

For extensions that want to add their own items, a new addExternalIndicator() method was added to help with that.

But there is nothing to help with modifying built-in items, so you’ll have to implement that yourself.

Something along those lines should work (untested, so take with a grain of salt):

    _modifySystemItem() {
       // do stuff
    }

   _queueModifySystemItem() {
        GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
            if (!Main.panel.statusArea.quickSettings._system)
                return GLib.SOURCE_CONTINUE;

            this._modifySystemItem();
            return GLib.SOURCE_REMOVE;
        });

       enable() {
            if (Main.panel.statusArea.quickSettings._system)
                this._modifySystemItem();
            else
               this._queueModifySystemItem();
        }

}

Hi @fmuellner Thank you so-much for the perfect code and explanation.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.