English letters are opposite case than Caps Lock LED or int'l letters if Caps Lock is pressed while waking up
[Please help me find the right component if it's not mutter.]
Summary
On Wayland, I can easily get to a state where the English letters are typed in in the opposite case than indicated by the Caps Lock LED.
- Caps Lock LED off => typing inserts upperase letters
- Caps Lock LED on => typing inserts lowercase letters
In the mean time, accented letters work as per the Caps Lock LED, so international layouts are straight unusable.
To trigger the bug, I need to hit Caps Lock while the laptop is waking up from suspend (which I often do as a pointless habit).
Steps to reproduce
- Log in to GNOME (or its Ubuntu flavor) over Wayland.
- Have US English as the default and currently used keyboard layout (I don't know if it's important).
- From the upper right corner's menu, choose "Suspend" (or close the lid).
- Wait for a few seconds.
- Press the Power button to wake up (or open the lid).
- After the fans spin up, but briefly before the display comes back to life, press Caps Lock. (Practice the timing... also might press that key a couple of times in quick succession.)
- "Caps Lock is on" message is shown on the lock screen, and the Caps Lock key's LED also lights up -- as expected.
- Type in your password. While doing so, you might want to make it visible. Also feel free to press Caps Lock as you please. The behavior, while typing the password, is as expected.
- When you're back at the desktop, type to an app (e.g. terminal). Notice that English letters work oppositely from the Caps Lock LED.
The only way I found to get out of this situation is to repeat the above steps (except for the first step of logging in), including the well-timed Caps Lock press. Or to log out and back in.
Also note: if I switch to Hungarian layout, the English letters are still the opposite of what the LED indicates, but the Hungarian accented letters are not. I.e. without pressing any of Caps Lock or Shift, I either get to type AáBCDEé or I get to type aÁbcdeÉ. That is, the bug is more serious than just an LED feedback issue.
While unlocking the screen, the state of the LED does not change, it's the behavior of the English letters that toggles. So probably the bug is also there: not with the LED indication, but with the actual behavior. Somehow the desktop partially misses that well-timed Caps Lock keypress while waking up the computer.
Also I have no idea how it should be possible at all to get to such a hybrid layout where the accented letters are the opposite of the ASCII ones; even if I deliberately wanted to get here, it shouldn't be possible (without creating a brand new and utterly useless layout definition).
System info
I can reproduce this on two laptops: Dell Inspiron 5559 and Dell Inspiron 7559.
Fully updated Ubuntu 24.04 beta (with Mutter 46.0-1ubuntu7, GNOME 46 etc.) on both.
Reproducible on long-existing accounts as well as brand new test accounts.
Reproducible on Wayland only. Xorg doesn't have this problem. Moreover, Xorg resets the Caps Lock state on keyboard layout change (which would presumably be a workaround), Wayland doesn't, it remains in this hybrid broken state.