Gnome shell extension element reordered after system lock

My gnome-shell extension adds element to top panel, right after gnome-shell reboot elements added as first(top one image). But after i lock and unlock system, order is changed and element now is last(bottom one image)
out

Here is how i add element in enable:

indicator = new StocksTicker();
Main.panel.addToStatusArea('stocksTicker', indicator);

And here is how i disable it:

if (indicator !== null) {
    indicator.destroy();
    indicator = null;
}

Can anyone explain to me why this happens?

P.S. Probably related to this, i get this error message in logs:
JS ERROR: TypeError: area is null

1 Like

Facing a similar issue.

GNOME Shell 3.36.6

Using Freon on the left side of panel. It moves towards the right after some time ( lock / unlock ? ). Thought it was an extension issue. Still not sure.

Thanks !

This is just expected behaviour for a container widget. The extensions are just being enabled/disabled in a different order, resulting in the panel buttons being inserted in a different order.

Some extensions have tried to re-order themselves in the status area, but I think if your use case requires your widget to be in a very specific place, you probably just shouldn’t be using the status area.

1 Like