Review of "GJS OSK" version 55

Details Page Preview

A new Onscreen Keyboard built using GNOME JS

Extension Homepage
https://github.com/Vishram1123/gjs-osk

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 6

Shexli found 7 issues that may need reviewer attention.

EGO-X-003 warning

extensions should not call run_dispose in extension code

Extension code should not call `run_dispose()`.

GObject.Object.run_dispose

  • extension.js:888
    this.inputDevice.run_dispose()

EGO-X-004 warning

extensions should avoid synchronous file IO in shell code

Shell code should avoid synchronous file IO APIs like `GLib.file_get_contents()` and `Gio.File.load_contents()`.

File Operations

  • extension.js:272
    GLib.file_get_contents(this.path + '/physicalLayouts.json')
  • extension.js:452
    GLib.file_get_contents(keycodesPath)

EGO-P-004 error

GSettings schema XML filename must match schema id

GSettings schema filename must match `<schema-id>.gschema.xml`.

GSettings Schemas

  • schemas/org.gnome.shell.extensions.gjsosk.gschema.xml
    id='org.gnome.shell.extensions.gjsosk.indicator' path='/org/gnome/shell/extensions/gjsosk/indicator/'

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:714
    this.nonDragBlocker = new Clutter.Actor()
  • extension.js:1268
            this.suggestionBox = new St.BoxLayout({
                x_expand: true,
                y_expand: true,
                visible: false
            })
  • extension.js:1558
    keyBtn
  • extension.js:1553
    keyBtn

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:714
    this.nonDragBlocker = new Clutter.Actor()
  • extension.js:1268
            this.suggestionBox = new St.BoxLayout({
                x_expand: true,
                y_expand: true,
                visible: false
            })

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

  • extension.js:523
                this._indicator.connect("button-press-event", () => {
                    this._toggleKeyboard();
                    return Clutter.EVENT_STOP;
                })
  • extension.js:582
                    this._indicator.connect("button-press-event", () => {
                        this._toggleKeyboard();
                        return Clutter.EVENT_STOP;
                    })
  • extension.js:527
                this._indicator.connect("touch-event", (_actor, event) => {
                    if (event.type() == Clutter.EventType.TOUCH_END) {
                        this._toggleKeyboard();
                        return Clutter.EVENT_STOP;
                    }
                    return Clutter.EVENT_PROPAGATE;
        
  • extension.js:586
                    this._indicator.connect("touch-event", (_actor, event) => {
                        if (event.type() == Clutter.EventType.TOUCH_END) {
                            this._toggleKeyboard();
                            return Clutter.EVENT_STOP;
                        }
                        return Clutt
  • extension.js:60
    item.connect('activate', () => this.settings.set_int("enable-tap-gesture", num))
  • extension.js:1369
            btn.connect("button-press-event", () => {
                action();
                return Clutter.EVENT_STOP;
            })
  • extension.js:1373
    btn.connect("button-release-event", () => Clutter.EVENT_STOP)
  • extension.js:1374
            btn.connect("touch-event", (_actor, event) => {
                const type = event.type();
                if (type == Clutter.EventType.TOUCH_BEGIN) {
                    action();
                    return Clutter.EVENT_STOP;
                }
                if (type == Clutter.EventType.TOUCH_END || type == Cl
  • extension.js:764
            this.edgeStrip.connect("touch-event", (actor, event) => {
                this.modalEdgeSwipe(event);
                return Clutter.EVENT_STOP;
            })
  • extension.js:1907
                item.connect("button-press-event", () => {
                    pressEv("mouse");
                    return Clutter.EVENT_STOP;
                })
  • extension.js:1911
                item.connect("button-release-event", () => {
                    releaseEv();
                    return Clutter.EVENT_STOP;
                })
  • extension.js:1781
                item.connect("destroy", () => {
                    if (item.button_pressed !== null) {
                        clearTimeout(item.button_pressed)
                        item.button_pressed = null
                    }
                    if (item.button_repeat !== null) {
                        clearInterval(
  • extension.js:1915
                item.connect("touch-event", (_actor, event) => {
                    const type = event.type();
                    if (type == Clutter.EventType.TOUCH_BEGIN) {
                        pressEv("touch");
                        return Clutter.EVENT_STOP;
                    } else if (type == Clutter.EventTy
  • extension.js:776
                    oskEdgeDragAction.connect('activated', () => {
                        this.open(true);
                        this.openedFromButton = true;
                        this.closedFromButton = false;
                        this.gestureInProgress = false;
                    })
  • extension.js:815
                    oskEdgeDragAction.connect('cancel', () => {
                        if (this.gestureInProgress) {
                            this.close()
                            this.openedFromButton = false;
                            this.closedFromButton = true;
                        }
                        th
  • extension.js:809
                    oskEdgeDragAction.connect('end', () => {
                        this.open(true);
                        this.openedFromButton = true;
                        this.closedFromButton = false;
                        this.gestureInProgress = false;
                    })
  • extension.js:782
                    oskEdgeDragAction.connect('gesture-cancel', () => {
                        if (this.gestureInProgress) {
                            this.close()
                            this.openedFromButton = false;
                            this.closedFromButton = true;
                        }
                  
  • extension.js:806
                    oskEdgeDragAction.connect('may-recognize', () => {
                        return Shell.ActionMode.ALL & ~Shell.ActionMode.LOCK_SCREEN & Main.actionMode;
                    })
  • extension.js:791
                    oskEdgeDragAction.connect('progress', (_action, progress) => {
                        if (!this.gestureInProgress)
                            this.open(false)
                        this.setOpenState(Math.min(Math.max(0, (progress / (side % 2 == 0 ? this.box.height : this.box.width)) * 100), 
  • extension.js:824
                    oskEdgeDragAction.connect('progress', (_action, progress) => {
                        if (!this.gestureInProgress)
                            this.open(false)
                        this.setOpenState(Math.min(Math.max(0, (progress / (side % 2 == 0 ? this.box.height : this.box.width)) * 100), 

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:313
    this.waitRefresh = setTimeout(refresh, 1000)

All Versions

Previous Reviews on this Version

JustPerfection rejected
1. Extensions cannot use `run_dispose()` (line 888 `extension.js`): [EGO Review Guidelines: run_dispose](https://gjs.guide/extensions/review-guidelines/review-guidelines.html#extensions-should-not-force-dispose-a-gobject) 2. Fix EGO-X-004 and EGO-L-004 mentioned by shexli.