Desklet reload failes with "Type name Gjs_{myclassname}" is already registered. #181
-
I'm developing a Cinnamon desklet app - that is extending St.Button with some additional data and from St.Button inherits GObject registration. IMHO there should be a mechanism exists to prevent such error as Reloading could not be happen and this is "not the fault" of the instance issued by the 2nd reload however such feature should be guaranteed by the framework. Reference: yarr/linkbutton.js |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You can't unload/reload GObject types (this isn't to do with gjs, but a behavior of GObject). You'll have to use delegation. like...
|
Beta Was this translation helpful? Give feedback.
-
Thanks for pointing on this. By using delegation and adding YarrLinkButton.getActor I was able to change the code to work ok on reload. Moreover I could realize I can add extra info to click event and use standard St.Button class without extension. :)
|
Beta Was this translation helpful? Give feedback.
You can't unload/reload GObject types (this isn't to do with gjs, but a behavior of GObject). You'll have to use delegation.
like...