Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent switching layout to us-extended.json in terminal mode #36

Merged
merged 3 commits into from
Mar 17, 2023
Merged

Prevent switching layout to us-extended.json in terminal mode #36

merged 3 commits into from
Mar 17, 2023

Conversation

jlempen
Copy link

@jlempen jlempen commented Feb 12, 2023

Add a new override for the getCurrentGroup() function in order to prevent the on-screen keyboard from switching to the us-extended.json layout in terminal mode.
Now we have our shiny new extended, localized keyboard layout, we don't want it to be replaced by the us-extended.json layout when using the terminal.

jlempen and others added 2 commits February 12, 2023 21:10
Add new override for the getCurrentGroup() function in order to prevent the on-screen keyboard from switching to the ùs-extended.json` layout in terminal mode, as our layout is already extended now.
@nick-shmyrev nick-shmyrev self-requested a review March 9, 2023 18:19
Copy link
Owner

@nick-shmyrev nick-shmyrev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! It seems to be working well in almost all of the cases, except one. It won't render the keyboard in the password dialog on lock screen.

Steps to reproduce:

  1. Log into the system.
  2. Click on the menu in the upper right corner of the screen.
  3. Click on the lock icon.
  4. Click anywhere on the screen to bring up password input, then click on it.
  5. OSK background panel will show up, but it won't have any buttons.

I've checked out the commit before I merged in my latest changes, and the issue was already present there. I'll see if I can trace down the reason for this.

Edit: Getting these errors in journalctl:

JS ERROR: Exception in callback for signal: groups-changed: TypeError: this._keyboardController.getCurrentGroup is not a function
_updateKeys@resource:///org/gnome/shell/ui/keyboard.js:1811:59
_onGroupChanged@resource:///org/gnome/shell/ui/keyboard.js:1816:14
_onKeyboardGroupsChanged@resource:///org/gnome/shell/ui/keyboard.js:1830:14
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:114:47
_onSourcesModified@resource:///org/gnome/shell/ui/keyboard.js:2194:14
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:114:47
_inputSourcesChanged@resource:///org/gnome/shell/ui/status/keyboard.js:620:14
reload@resource:///org/gnome/shell/ui/status/keyboard.js:365:14
_ibusSetContentType@resource:///org/gnome/shell/ui/status/keyboard.js:700:14
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:114:47
_setContentType@resource:///org/gnome/shell/misc/ibusManager.js:277:14

JS ERROR: Exception in callback for signal: active-group: TypeError: this._keyboardController.getCurrentGroup is not a function
_updateKeys@resource:///org/gnome/shell/ui/keyboard.js:1811:59
_onGroupChanged@resource:///org/gnome/shell/ui/keyboard.js:1816:14
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:114:47
_onSourceChanged@resource:///org/gnome/shell/ui/keyboard.js:2200:14
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:114:47
_currentInputSourceChanged@resource:///org/gnome/shell/ui/status/keyboard.js:452:14
activateInputSource@resource:///org/gnome/shell/ui/status/keyboard.js:492:14
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:114:47
activate@resource:///org/gnome/shell/ui/status/keyboard.js:60:14
_inputSourcesChanged@resource:///org/gnome/shell/ui/status/keyboard.js:625:33
reload@resource:///org/gnome/shell/ui/status/keyboard.js:365:14
_ibusSetContentType@resource:///org/gnome/shell/ui/status/keyboard.js:700:14
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:114:47
_setContentType@resource:///org/gnome/shell/misc/ibusManager.js:277:14

@jlempen
Copy link
Author

jlempen commented Mar 13, 2023

Hi @nick-shmyrev,

Thanks for your review and for your great work on this extension!

I pulled all your recent commits and added mine. I'm unable to reproduce the lock screen issue you mentioned. On my device, a Core m3 Surface Go 2 running an up-to-date Arch Linux with Gnome 43.3 on Wayland, the ch+FR.json OSK layout renders perfectly on the lock screen in both the landscape and portrait orientations. The GDM login screen renders fine as well, but I remember reading a comment from the lead developer of the gnome-shell OSK that the GDM login screen actually uses its own built-in us OSK and has nothing to do with the gnome-shell OSK.

Also, I do not get any JS ERROR related to the improved-osk-gnome-ext extension in the journalctl logs and the gnome-shell looking glass doesn't throw any errors for the extension.

With my commits, the default GNOME Console v43 doesn't switch to the us-extended.json layout and uses my extended ch+fr.json layout as expected. I have to summon the OSK manually by swiping up from the lower screen edge, though. That's expected as well, as the GNOME Console is a GTK4 app and GTK4 apps won't open the OSK automatically yet.

@nick-shmyrev
Copy link
Owner

@jlempen My bad, it looks like it's not the actual lock screen, but Gnome's screensaver(?). This happens in a VirtualBox VM running Fedora 37 with gnome-shell v43.3 under Wayland. This is what I'm seeing there:

image

I've also found a workaround: once on the screensaver's login screen, click/tap on the password input to hide the empty OSK container, then click on "Switch users" icon in the lower right corner. This will bring up the actual login screen, where you'll have access to Gnome's default OSK.

Copy link
Owner

@nick-shmyrev nick-shmyrev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it would be great to fix this, I suppose I could merge these changes in, and add another section to FAQ mentioning this is a known issue and the workaround.

You'll need to change the merge target for this PR, since I've already merged the gnome_43_rewrite branch into master.

@nick-shmyrev nick-shmyrev changed the base branch from gnome_43_rewrite to master March 17, 2023 20:40
@nick-shmyrev
Copy link
Owner

PR #39 seems to have solved the issue with OSK not properly rendering in screensaver login dialog. Thanks @PhilDevProg!

@nick-shmyrev nick-shmyrev merged commit c7cb598 into nick-shmyrev:master Mar 17, 2023
nick-shmyrev added a commit that referenced this pull request Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants