Review of "Main Layout on Lock Screen" version 4

Details Page Preview

This was a temporary solution. Please use the original Primary Input on LockScreen extension. Automatically change the keyboard layout on the lock screen to the first one in your list. This is a small, simple extension that solves an annoying issue for users with several different keyboard layouts (until it gets solved upstream). Whenever the lock screen kicks in, this extension checks for the currently selected keyboard layout and switches it to the main one (the first one in your list of keyboard layouts in Settings). This is a fork and ESM port of the Primary Input on LockScreen extension.

Extension Homepage
https://gitlab.com/somepaulo/main-layout-on-lock-screen-gnome-shell-extension

No comments.

Diff Against

Files

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

All Versions

Version Status
5 Inactive
4 Rejected
3 Rejected
2 Rejected
1 Rejected

Previous Reviews on this Version

somepaulo posted a review
Hi! Your initial suggestion of declaring `inputSourceManager` in `enable` broke the extension. It simply wouldn't change layouts, but throwed no errors. It would only work with the declaration outside the extension class. But I kept digging, and what ended up working was moving it to `constructor`. Another thing is that using only the `unlock-dialog` state marks the extension as disabled in all extension management interfaces, which is confusing to users. The extension keeps working in this mode while on the lock screen, so it's just a UI confusion for such extensions. They should be marked as enabled in `user` session mode even if they don't function in it. To mitigate this, I added the `user` session mode and reinstated the check for `isLocked` on `disable`.
JustPerfection rejected
1. Selective disable is not allowed (line 45 `extension.js`) [EGO Review Guidelines: Selective Disable](https://gjs.guide/extensions/review-guidelines/review-guidelines.html#session-modes) 2. You should still move line 29 to enable and null that out in disable. Anyway, does this work for you? ```js import * as Main from "resource:///org/gnome/shell/ui/main.js"; import * as KeyboardStatus from 'resource:///org/gnome/shell/ui/status/keyboard.js'; export default class PrimaryInputOnLockScreen { enable() { this.setPrimaryOnLock(); this._sessionId = Main.sessionMode.connect( 'updated', this.setPrimaryOnLock.bind(this) ); } disable() { /* // This extensions uses the `unlock-dialog` session mode // because it only needs to operate on the unlock screen // in order to check and change the current keyboard layout. // However, it also uses `user` session mode to avoid confusing // users by appearing disabled in extension management interfaces. */ if (this._sessionId) { Main.sessionMode.disconnect(this._sessionId); this._sessionId = null; } } setPrimaryOnLock() { if (!Main.sessionMode.isLocked) { return; } const inputSourceManager = KeyboardStatus.getInputSourceManager(); const primaryInput = inputSourceManager.inputSources["0"]; const currentInput = inputSourceManager.currentSource; if (currentInput != primaryInput) { primaryInput.activate(); } } } ```
somepaulo posted a review
Thank you! This works just fine. Resubmitting with renamed constants to follow the new extension name.