Bug 476953 - Meta/Super/Win/Cmd key does not respect keyboard layout in X11
Summary: Meta/Super/Win/Cmd key does not respect keyboard layout in X11
Status: RESOLVED UPSTREAM
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR major
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-13 17:07 UTC by Zach White
Modified: 2024-02-16 21:03 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zach White 2023-11-13 17:07:58 UTC
SUMMARY
When using multiple keyboard layouts the "Meta" key (aka Super or Win or Command) will only use the default layout rather than using the currently chosen layout, breaking keyboard shortcuts. 

On my setup I have "Dvorak" as my primary keyboard layout and "Qwerty" as an option for people who use my computer. However, when they press Super the keys revert to dvorak, so they have to press the dvorak location to use a key. For example, I have meta+w assigned to close the current window, and while Qwerty is selected they have to press meta+comma to close a window, instead of meta+w.

If I switch the order of the two keyboards the problem reverses, now when dvorak is selected I have to use qwerty keys while holding down meta. 

STEPS TO REPRODUCE
0. These steps assume you have "English (US)" with no Variant as your default keyboard layout
1. Open System Settings -> Workspace -> Shortcuts -> KWin -> Close Window
2. Set Custom Shortcuts to Meta+W, click Apply
3. Press Meta+W, observe that the window closes
4. Open System Settings -> Hardware -> Input Devices -> Keyboard -> Layouts
5. Click "Add" to add a new layout
6. Select "English (Dvorak)"
7. Click "Apply"
8. Switch to the Dvorak layout (I use the icon on the right side of the start bar)
9. Hold down Meta and press the key to the right of "M" (this is W on Dvorak)
10. Observe that the window does not close, even though you just pressed Meta+W
11. Verify that the keyboard layout is still set to Dvorak, but press Meta+Qwerty W
12. Observe that the window closes, even though you just typed Meta+Comma
13. Swap the order of the keyboard layouts and try steps 8-12 again, observe that now when holding down Meta all the keys correspond to Dvorak.

OBSERVED RESULT
While holding down Meta the pressed keys correspond to the First keyboard layout.

EXPECTED RESULT
While holding down Meta the pressed keys correspond to the Selected keyboard layout.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 5.27
(available in About System)
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.11

ADDITIONAL INFORMATION
Only tested in X11, not tested in Wayland
Comment 1 Nate Graham 2023-11-15 20:32:36 UTC
Can you test on Wayland too? The way keys are handled differs between X11 and Wayland.
Comment 2 Zach White 2023-11-19 18:55:16 UTC
I'm in Wayland right now and this does work properly, holding Meta and pressing W closes the window, no matter which keyboard layout I've selected. 

Unfortunately there's a lot that doesn't work properly in Wayland for me (such as latte-dock and the fact that UltrawideWindows no longer recognizes any of my panels and places windows behind them) so this isn't a viable option for me at this time.
Comment 3 Bug Janitor Service 2023-12-04 03:45:47 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Nate Graham 2024-02-16 21:03:54 UTC
Thanks. If it works on Wayland then that means on X11 it's unfortunately an upstream bug in the X server.