Multiple extensions from gnome-shell-extensions repo call Gio.Settings.run_dispose() to avoid disconnecting from changed signal(s) manually - at least it’s auto-move-windows, places-menu, user-theme, window-list.
However, the same call is one of the reasons my extension was rejected.
I thought gnome-shell-extensions should be an example of how to implement extensions correctly.
So, is Gio.Settings.run_dispose() call acceptable or not?
If you can justify why it is necessary to use GObject.Object.run_dispose() for a particular case, then it can reviewed as such, but otherwise it is not permitted to use it simply as an easy way to disconnect signals.
I’d also consider simplifying the changed signal handling by calling run_dispose() before nulling the variable.
Disconnecting all changed signal handlers automatically in disable(), without the need to track them. Otherwise, the handlers can be called when the extension is disabled, and need to be disconnected manually.
That’s not what GObject.Object.run_dispose() is for, and there are other methods for disconnecting signals, so I would not consider that a rationale.
I understand many developers consider this to be an undue burden, but I think the situation is overblown a little bit. It’s not so much work to disconnect signals, and ensure you’re thinking about what/when you’re connecting to them.
The extensions from the gnome-shell-extensions repository can be roughly categorized as:
few extensions I sometimes use (screenshot-window-sizer for taking appdata screenshots, light-style for testing)
gnome-classic, which I maintain as part of my job
a random collection of extensions that predate the website, and a git repository was more suitable for collaboration than attachments on a mailing list
The last category makes up half of the extensions. I have never used any of them, or care particular about the functionality they provide. Despite that, I have kept them working for over a decade, but that’s the maximum work I’m willing to invest in them.
Turning the repository into a set of “model extensions” would be additional work, and that’s not something I’m willing to do for that last set of extensions.
That is, if there is an expectation now that the repository serves a second purpose as “reference extensions”, then a precondition would be that all extensions I don’t care about personally or as part of my job are dropped first.
Until then, the extension templates included with gnome-shell and the examples on gjs.guide are better references.
For what it’s worth, most of the gjs.guide Topics now exist as fully functional examples, that can be found in their respective src/ directory. I had some vague thoughts of taking that a bit further, but there are many things to do