Review of "Eye on Cursor" version 3.0.0 (24)

Details Page Preview

Add animated eyes to your GNOME panel that follow your mouse cursor. Bring your desktop to life! Comes with a cursor tracker to help you keep track of your pointer during presentations, screencasts, or everyday use. Features: - Panel eyes that follow your mouse cursor - Eye shape, color, and blinking customization - Customizable cursor tracker with keyboard shortcut Forked from Eye and Mouse Extended by Alexey Lovchikov.

Extension Homepage
https://gitlab.gnome.org/DjinnAlexio/eye-on-cursor/

No comments.

Diff Against

Files

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

Shexli (experimental) error 1 warning 1

Shexli found 2 issues that may need reviewer attention.

EGO-P-002 error

GSettings schema path must use /org/gnome/shell/extensions base

GSettings schema path must start with `/org/gnome/shell/extensions`.

GSettings Schemas

  • schemas/org.gnome.shell.extensions.eye-on-cursor.eye.gschema.xml
    id='org.gnome.shell.extensions.eye-on-cursor.eye' path=''

EGO-L-003 warning

signals connected by extension should be disconnected in disable()

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

Disconnect all signals

  • extensionModules/utils.js:74
        source.connect('destroy', () => {
            source = null;
        })
  • extensionModules/utils.js:89
    notification.connect('activated', () => extension.openPreferences())

All Versions

Version Status
3.0.2 (26) Active
3.0.1 (25) Rejected
3.0.0 (24) Rejected
2.4.1 (23) Active
2.4.1 (22) Rejected
2.4.1 (21) Rejected
2.4.0 (20) Rejected
2.3.1 (19) Inactive
2.3.0 (18) Rejected
2.2.1 (17) Inactive
2.2.1 (16) Rejected
2.2.0 (15) Inactive
2.1.1 (14) Inactive
2.1.0 (13) Inactive
2.0.0 (12) Inactive
2..0.0 (11) Rejected
1.4.0 (10) Inactive
1.3.2 (9) Inactive
1.3.1 (8) Inactive
1.3.0 (7) Rejected
1.2.1 (6) Inactive
1.2.0 (5) Inactive
1.1.1 (4) Inactive
1.1.0 (3) Rejected
1.0.1 (2) Inactive
1.0.0 (1) Inactive

Previous Reviews on this Version

JustPerfection rejected
1. `path` for the XML file is missed. 2. Timeout should be removed on destroy and before creating a new one (line 115 `extensionModules/blinkController.js`): [EGO Review Guidelines: Timeout](https://gjs.guide/extensions/review-guidelines/review-guidelines.html#remove-main-loop-sources)
Djinn Alexio posted a review
2. Tis good? ``` #scheduleNextSyncBlink() { // Calculate a random interval to next blink const interval = this.#blinkIntervalRange[0] + ((this.#blinkIntervalRange[1] - this.#blinkIntervalRange[0]) * Math.random()); return setTimeout(() => { this.#blinkAll(); + this.#randomSyncTimeout = clearTimeout(this.#randomSyncTimeout); this.#randomSyncTimeout = this.#scheduleNextSyncBlink(); }, 1000 * interval); } 1) That's what I was talking about last time. In order for eyes to have their own schema, I need a template without path so that the path can be defined at creation: [Relocatable schemas](https://docs.gtk.org/gio/class.Settings.html#relocatable-schemas) ``` const eyeSchema = extension.settings.get_child('eye').settings_schema; const eyeSchemaPathRoot = `${extension.settings.settings_schema.get_path()}eyes/`; // Create eye array const count = extension.settings.get_int('eye-count'); for (let i = 1; i <= count; i++) { const eyeID = String(i).padStart(2, '0'); const eyeName = `eye-${eyeID}`; const eyeSettings = new Gio.Settings({ settings_schema: eyeSchema, path: `${eyeSchemaPathRoot}${eyeName}/`, }); extension.eyeArray.push(new Eye(extension, eyeSettings, eyeName)); } ``` This, with line 342 `prefsModules/eyeSettings.js`, adds paths such as '/org/gnome/shell/extensions/eye-on-cursor/eyes/eye-01', '/org/gnome/shell/extensions/eye-on-cursor/eyes/eye-02', etc., for each eye object. Having a path in the xml when trying to create the schema with a new one leads to an error (GSettings created for path '/org/gnome/shell/extensions/eye-on-cursor/eyes/eye-01/', but schema specifies '/org/gnome/shell/extensions/eye-on-cursor/eye/'). And having just a static path leads back to the beginning of eyes sharing the same settings. Using `get_child` instead on `lookup` to find the schema doesn't address the problem.
JustPerfection posted a review
For the timeout. No. That's not good. `setTimeout()` returns the timeout id, that's what you should store and remove.
Djinn Alexio posted a review
I think I see? ``` #scheduleNextSyncBlink() { // Calculate a random interval to next blink const interval = this.#blinkIntervalRange[0] + ((this.#blinkIntervalRange[1] - this.#blinkIntervalRange[0]) * Math.random()); this.#randomSyncTimeout = clearTimeout(this.#randomSyncTimeout); this.#randomSyncTimeout = setTimeout(() => { this.#blinkAll(); this.#scheduleNextSyncBlink(); }, 1000 * interval); } ``` Now it mirrors `#scheduleNextBlink(eye)`. Do I do the same there?
JustPerfection posted a review
That's correct now. Don't forget to also remove that timeout source id on destroy.