gdm must show all input sources by default, otherwise it's easy to be unable to type in your password
If you configure your system with a keyboard layout which is hidden by default, gdm currently ignores it and falls back to a different layout silently. That might prevent you from being able to type in your password and log in.
Reproducer (this is what happened to me):
- Enable "Show extended keyboard sources" in gnome-tweaks (log out and back in, as instructions say)
- Replace your current keymap selection with something from the extended sources. In my case, I replaced
[('xkb', 'us'), ('xkb', 'cz+qwerty')]
[('xkb', 'us+cz_sk_de'), ('xkb', 'cz+qwerty')]
I tested in my session that
us+cz_sk_de is identical to
us, it just has extra characters when right alt is pressed.
- This is a single user system, so your changes have been automatically applied system-wide.
- On next boot (in my case, a week later!), notice that you can't log in, it always says your password is wrong. Also notice, that gdm no longer shows a keyboard layout selector widget in the top bar - that's weird, there always used to be "EN" and "CZ", and now there's nothing. Which layout am I using?
- Be sad/angry/go back to Windows/etc. Or hopefully figure out what's going on (a different than expected layout is used) and be lucky enough to be able to type in your password using the current (undisclosed) layout.
What happens here is that
us+cz_sk_de keymap is ignored by gdm, because it's an extended layout, and gdm ignores those. It then falls back to the next layout, or if there's no further layout, probably to US layout (this is just a guess). Additionally, it doesn't show keymap selector, because there's suddenly only one layout, and in that case it suppresses the widget. That leaves the user even more in the dark.
This is all related to gsettings option
org.gnome.desktop.input-sources show-all-sources which defaults to
false. If you set it to
true for gdm, this problem is avoided. This is how:
$ sudo su - gdm -s /bin/bash -c 'dbus-launch --exit-with-session gsettings set org.gnome.desktop.input-sources show-all-sources true'
In my example, I was able to log in because I figured out what's going on and because they keymaps were sufficiently similar. But just imagine if my second keymap hadn't been able to type latin characters. Or if I had just a single keymap which would have fallen back to US keyboard in gdm, but I'd have need to input a non-latin character as a part of my password. I'd have been completely locked out of my system. Those are really harsh consequences.
I imagine this can get solved in several ways:
- Alternatively, ignore
show-all-sourcesin gdm and always show all configured keyboard layouts (I think this makes most sense and is most error-prone). The option makes sense in configuration tools like gnome-control-center, but doesn't make sense in gdm or even a regular gnome session (when something is configured, show it).
- Always show keyboard layout indicator in gdm, even when just a single keymap is configured. That will avoid many problematic issues users can have when configuring keymaps and helps the user to understand which keymap is currently being used, when unsure.
gdm-3.30.1-2.fc29.x86_64 gnome-shell-3.30.1-1.fc29.x86_64 gnome-control-center-3.30.1-3.fc29.x86_64 Fedora 29