Bug 501917 - Keyboard layout switching breaks if the first layout matches the system layout
Summary: Keyboard layout switching breaks if the first layout matches the system layout
Status: REPORTED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keyboard (show other bugs)
Version: 6.3.3
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-23 17:33 UTC by Janne Grunau
Modified: 2025-03-24 20:24 UTC (History)
3 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 Janne Grunau 2025-03-23 17:33:53 UTC
When the first keyboard layout matches the system layout the keyboard layout systray button is missing and switching via shortcut (Meta+Alt+k) does not work. After modifying the order so that the system layout is not the first entry switching works as expected.

locatectl
|    VC Keymap: us
|    X11 Layout: us
|    X11 Model: applealu_iso

cat ~/.config/kxkbrc 
| [Layout]
| DisplayNames=,,
| LayoutList=us,eu,de
| Model=applealu_iso
| Use=true
| VariantList=mac,,nodeadkeys

After changing the order to

cat ~/.config/kxkbrc 
| [Layout]
| DisplayNames=,,
| LayoutList=eu,us,de
| Model=applealu_iso
| Use=true
| VariantList=,mac,nodeadkeys

everything works as expected.



STEPS TO REPRODUCE
1. Go to keyboard configuration in System Settings
2. Enable "Layouts" and add system layout
3. add another layout and apply

OBSERVED RESULT
Switching between the the layouts is not possible. no keyboard layout systray icon and the keyboard shortcut is not working either

EXPECTED RESULT
active layout is displayed in the systray icon and switching between different keyboard layouts works

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux Asahi Remix 41
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2

ADDITIONAL INFORMATION
originally reported in https://discussion.fedoraproject.org/t/keyboard-layout-switching-stopped-working/146988
Comment 1 duha.bugs 2025-03-24 16:32:50 UTC
After first trying to reproduce this, I could partially. I was only able to switch to my non system language with the shortcut. The applet did work though, including clicking on it.

After resetting my settings to default and adding the languages again, I can no longer reproduce.

The settings I tried to reproduce with:
localectl
System Locale: LANG=en_US.UTF-8
    VC Keymap: us
   X11 Layout: us
    X11 Model: pc105+inet
  X11 Options: terminate:ctrl_alt_bksp

cat ~/.config/kxkbrc 

[$Version]
update_info=kxkb.upd:remove-empty-lists,kxkb.upd:add-back-resetoptions,kxkb_variants.upd:split-variants

[Layout]
DisplayNames=,
LayoutList=us,de
Use=true
VariantList=,


What [$Version] do you get in your ~/.config/kxkbrc ?
Comment 2 Janne Grunau 2025-03-24 20:24:15 UTC
(In reply to duha.bugs from comment #1)
>
> What [$Version] do you get in your ~/.config/kxkbrc ?

none. The reported contents of ~/.config/kxkbrc are complete. It was always just the "Layout" section. In addition "Options=" in the Layout section have no effect as well in the broken system layout is first case.

The issue does *not* reproduce on my desktop with identical software. Settings there:
$localectl 
System Locale: LANG=en_US.UTF-8
    VC Keymap: us
   X11 Layout: (unset)         
$ cat ~/.config/kxkbrc  
[$Version]
update_info=kxkb.upd:remove-empty-lists,kxkb.upd:add-back-resetoptions,kxkb_variants.upd:split-variants

[Layout]
DisplayNames=,,
LayoutList=us,eu,de
Options=caps:ctrl_modifier
ResetOldOptions=true
Use=true
VariantList=euro,,nodeadkeys