Is there a way to deregister a GJS subclass type? #570
-
I have some Javascript for a new Cinnamon extension I am writing that use |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I dealt with this for another applet. The source file should help you here. I ended up just hacking around the class name with the random value and that resolved the class register/deregister conundrum. (You can add logging to the applet and see the class names for how it registers/deregisters if you're curious.) It's a hack because as you can imagine, it has the potential to waste memory for each register/deregister until Cinnamon is reloaded but as it isn't much memory and the number of events for it to matter would need to be rather extreme, it was a tradeoff I could live with. If your next applet (can't wait!) will require frequent and constant adjusting, it may not work. If the applet's configuration will stabilize, this should hopefully help. |
Beta Was this translation helpful? Give feedback.
-
I had considered randomizing the name but I was hoping for something less hacky. I am satisfied knowing that I am not alone here and that I am not missing an obvious non-hacky solution that just escaped my google search. Thanks!! |
Beta Was this translation helpful? Give feedback.
I dealt with this for another applet. The source file should help you here. I ended up just hacking around the class name with the random value and that resolved the class register/deregister conundrum. (You can add logging to the applet and see the class names for how it registers/deregisters if you're curious.)
It's a hack because as you can imagine, it has the potential to waste memory for each register/deregister until Cinnamon is reloaded but as it isn't much memory and the number of events for it to matter would need to be rather extreme, it was a tradeoff I could live with. If your next applet (can't wait!) will require frequent and constant adjusting, it may not work. If the apple…