Bug 493167 - "Switch to Next Keyboard Layout" shortcut does not loop to beginning of list with variants of the same base language
Summary: "Switch to Next Keyboard Layout" shortcut does not loop to beginning of list ...
Status: RESOLVED NOT A BUG
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keyboard (show other bugs)
Version: 6.1.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-15 17:45 UTC by Madacyn
Modified: 2024-09-27 20:11 UTC (History)
5 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 Madacyn 2024-09-15 17:45:09 UTC
SUMMARY
If multiple keyboard layouts are configured, using the "Switch to Next Keyboard Layout" shortcut does not loop through the list. Meaning, when the last layout is reached in the list, using the shortcut does not result in a change of layout.

STEPS TO REPRODUCE
1. Configure multiple keyboard layouts via System Settings -> Keyboard -> Layouts -> Configure Layouts checkbox -> Add
2. Press the "Switch to Next Keyboard Layout" shortcut (Meta + Alt + K by default)
3. Observe a change in layout
4. Repeat step #2 until the last keyboard layout is reached
5. Press the "Switch to Next Keyboard Layout" shortcut (Meta + Alt + K by default)
6. Observe that a change in layout is NOT applied

OBSERVED RESULT
A change in layout IS NOT applied. The last keyboard layout in the list is selected

EXPECTED RESULT
A change in layout IS applied. The layout list is looped and the first layout in the list is selected.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 40
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.9-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 7950X3D 16-Core Processor
Memory: 62.0 GiB of RAM
Graphics Processor: AMD Radeon RX 7900 XTX

ADDITIONAL INFORMATION
None at this time, but I am happy to supply more information if needed

Thanks!
Comment 1 Nate Graham 2024-09-16 17:32:36 UTC
Hmm, on git master, this is working as expected for me with those exact steps. It wraps normally after reaching the end.

Can you reproduce this issue in a new clean user account with no customizations except for adding some extra keyboard layouts?
Comment 2 Madacyn 2024-09-17 01:38:07 UTC
After creating a new user and testing with various combinations of keyboard layouts, I think I have a better understanding of how to reproduce this bug. I apologize for not including what keyboard layouts I was using in the original report!

When I originally created this bug, I had 2 keyboard layouts configured. I was able to reproduce the issue on a new user with this combination:
1. English (US)
2. English (Colemak)

With a keyboard layout combination of the following, the functionality works as I would expect:
1. English (US)
2. English (Canada)

The following combination can also reproduce the issue. The interesting part about this combination though, is the action seems to get "stuck" on the English (Colemak) variant, and doesn't move to the English (Canada) variant, leading me to believe that perhaps something about the English (Colemak) variant is causing issues with the logic.
1. English (US)
2. English (Colemak)
3. English (Canada)

Hopefully this helps you reproduce!

If I were more familiar with the KDE code base, I would happily look into patching this myself. Hopefully it's an easy one now with these additional details! :)
Comment 3 Nate Graham 2024-09-17 19:40:28 UTC
Aha, I can reproduce that issue now.
Comment 4 Madacyn 2024-09-27 20:11:23 UTC
I have only now just realized that this is the expected behavior... 

Since the 'K' key is in a different position for Colemak, pressing the same physical key combination is actually (Meta + Alt + E). By pressing the physical key in the *new* location (So, the 'N' key on a QWERTY layout), the layout correctly moves to the next layout.

~insert facepalm gif here~