Review of "Monitor Input Switch" version 1

Details Page Preview

Switch an external monitor's input source (HDMI/DP/USB-C) via ddcutil. Requires ddcutil to be installed and working.

Extension Homepage
https://github.com/nemofq/monitor-input-switch

No comments.

FAQ

Files

Note: Binary files aren't shown on the web site. To see all files, please download the extension zipfile.

Shexli (experimental) warning 3

Shexli found 3 issues that may need reviewer attention.

EGO-L-002 warning

objects created by extension should be destroyed in disable()

Objects assigned in `enable()` are missing matching `.destroy()` calls in `disable()` or its helper methods.

Destroy all objects

  • extension.js:31
    this._itemsSection = new PopupMenu.PopupMenuSection()

EGO-L-005 warning

owned object references should be released in disable()

Owned references that are cleaned up in `disable()` should also be released with `null` or `undefined`.

Destroy all objects

  • extension.js:31
    this._itemsSection = new PopupMenu.PopupMenuSection()

EGO-L-004 warning

main loop sources should be removed in disable()

Main loop sources assigned in `enable()` are missing matching removals in `disable()` or its helper methods.

Remove main loop sources

  • extension.js:134
            this._scanTimeoutId = GLib.timeout_add(
                GLib.PRIORITY_DEFAULT, MONITORS_CHANGED_SETTLE_MS, () => {
                    this._scanTimeoutId = 0;
                    this._recheckTarget();
                    return GLib.SOURCE_REMOVE;
                })
  • extension.js:123
                this._startupTimeoutId = GLib.timeout_add(
                    GLib.PRIORITY_DEFAULT, MONITORS_CHANGED_SETTLE_MS, () => {
                        this._startupTimeoutId = 0;
                        this._scan();
                        return GLib.SOURCE_REMOVE;
                    })

All Versions

Version Status
4 Active
3 Rejected
2 Rejected
1 Rejected

Previous Reviews on this Version

JustPerfection rejected
1. Please use `connectObject()` and `disconnectObject()` so it is easier to track for cleanup. 2. Timeout should be removed before creating a new one (line 127 `ddcutil.js`). 3. The things you are doing with spawn in `ddcutil.js` should be done with d-bus instead: [D-Bus Guide](https://gjs.guide/guides/gio/dbus.html) You can also add `donations` to the `metadata.json`, so people can donate to you if they want: [Extension Anatomy: donations](https://gjs.guide/extensions/overview/anatomy.html#donations) If you need any help with your extension you can ask us on: - [GNOME Extensions Matrix Channel](https://matrix.to/#/#extensions:gnome.org) - IRC Bridge: irc://irc.gimpnet.org/shell-extensions