Bug 499097

Summary: Keyboard layout differs between X11 and Wayland sessions
Product: [Applications] systemsettings Reporter: Porkepix <porkepix>
Component: kcm_keyboardAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: butirsky, dev, duha.bugs, kde, natalie_clarius, nate
Priority: NOR    
Version First Reported In: 6.2.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: List of keyboard layouts

Description Porkepix 2025-01-24 16:16:53 UTC
SUMMARY

The layout really used by the session is a different one compared to the configured one in Wayland session.
I had French alt. layout configured on this KDE/Plasma. This is an old config, dating from 5.x as I don't use these sessions that often. While the X11 session encounters no issues and respect the set French alt. layout, when the session is a Wayland one, it uses a French layout (ie. first letters row is azerty), but a different one: special characters keys acts differently. I didn't searched which layout was it exactly using, but definitely not the configured one it should have.

STEPS TO REPRODUCE

1. Have French alt. layout set, and use Wayland session
2. Try to type special characters, and see that what you obtain is different than what you can see in the preview

OBSERVED RESULT

Layout isn't respected and it ends up using a different French layout.

EXPECTED RESULT

It should respect the set layout.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: ArchLinux
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.2.5
Qt Version: 6.8.1

ADDITIONAL INFORMATION
Comment 1 Porkepix 2025-01-24 18:38:21 UTC
Note it also breaks some shortcuts between X11 and Wayland session.
Comment 2 Nate Graham 2025-01-27 20:50:04 UTC
Are you able to set the layout to the one you expect in the Wayland session?
Comment 3 Porkepix 2025-01-27 22:51:24 UTC
Created attachment 177736 [details]
List of keyboard layouts

(In reply to Nate Graham from comment #2)
> Are you able to set the layout to the one you expect in the Wayland session?

Well, it's the curious thing: In the graphical interface, the layout was set to the one I wanted. But when I was actually typing, it was using another variant of French layout.

Now, to make things even more curious: I added a third layout on the Wayland session, which was exactly the same one as the first (French alt), see joined screenshot. After that, when switching layouts, the first French one of the list was not the one shown, but the third one (appearing as exactly the same as the first) was acting as it should and using the correct variant. I could switch as many times as I wanted, the first one was broken, third one was working as intended.

Then I logged out and re-logged. After logging in again, both were now working as intended. I can't explain what happened during the process…
Comment 4 Nate Graham 2025-01-28 00:42:50 UTC
It seems like maybe the layouts differ between X11 and Wayland, which could explain why reconfiguring it again on Wayland gets you the right setup.
Comment 5 Porkepix 2025-01-28 00:49:53 UTC
(In reply to Nate Graham from comment #4)
> It seems like maybe the layouts differ between X11 and Wayland, which could
> explain why reconfiguring it again on Wayland gets you the right setup.

Thing is, I never "reconfigured" the first layout: I merely added a third to the two already existing ones. And after that, moving again between X11 and Wayland sessions didn't changed anything: things looks definitely fixed. But then why doing this fixed the already existing one, I've no idea about that… (I didn't removed the third yet, for now)
Comment 6 Wismill 2025-02-14 10:48:19 UTC
It seems a migration issue of the config, fixed by editing the config in Wayland. I would expect it to be fixed also by editing the keyboard config in the X11 session.