Sorry for the long post but I have a couple issues with my extension that are beyond my experience level and need some help with. I’ll try to be brief.
I have an extension.js that adds a series of StatusPanels
, extending St.BoxLayout
, to this.main.box
. Each panel has an icon and label describing the status of a server, up or down. Each panel polls a server periodically and updates its icon. Everything lays out ok but I’m getting startup errors:
Can’t update stage views actor overviewGroup is on because it needs an allocation.
Can’t update stage views actor overview is on because it needs an allocation.
Can’t update stage views actor Gjs_ui_overviewControls_ControlsManager is on because it needs an allocation.
Can’t update stage views actor Gjs_ui_workspaceThumbnail_ThumbnailsBox is on because it needs an allocation.
Can’t update stage views actor Gjs_ui_workspaceThumbnail_WorkspaceThumbnail is on because it needs an allocation.
Can’t update stage views actor ClutterActor is on because it needs an allocation.
Can’t update stage views actor ClutterActor is on because it needs an allocation.
Can’t update stage views actor Gjs_ui_workspaceThumbnail_WindowClone is on because it needs an allocation.
Can’t update stage views actor ClutterClone is on because it needs an allocation.
I assume they’re from my extension; I have all other extensions turned off.
Further, the extension listens for preference changes then removes and recreates all the panels. Then I get other errors:
Object St.Icon (0x5650d76fd230), has been already deallocated — impossible to set any property on it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
== Stack trace for context 0x5650d5733120 ==
#0 7ffe80bf4790 b /home/craig/.local/share/gnome-shell/extensions/serverstatus@footeware.ca/statusPanel.js:111 (3ded9b7c5a10 @ 152)
This seems to related to the updating of the panels’ icons. I find that strange because in my prefs listener I call:
this.menu.box.destroy_all_children();
…then I recreate the panels and their icons so I don’t see how old ones are left around. I tried wrapping each icon access in an if-block:
const gicon = (message.status_code == 200) ? this.serverUpIcon : this.serverDownIcon;
log('before null check, icon is ’ + icon);
if (icon != null) {
log('after null check, icon is ’ + icon);
icon.gicon = gicon;
this.updateTaskbarCallback();
}
This produces the output:
before null check, icon is [null]
== Stack trace for context 0x5650d5733120 ==
#0 5650d6e330a8 i /home/craig/.local/share/gnome-shell/extensions/serverstatus@footeware.ca/statusPanel.js:104 (3ded9b7c5420 @ 144)
Object St.Icon (0x5650d7704870), has been already deallocated — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
after null check, icon is [null]
You can see the icon is reported as null, I guess indicating it’s a stale resource somehow, but then it ignores the if check and displays code in the if-block. Not sure how that’s possible.
Anyhow, if you can provide some insights here I’d really appreciate it. I didn’t want to post a lot of code here to keep a long post shorter but you can see it all on github. Thanks in advance.