Bug 434632

Summary: layouts error in wayland session but without error in X11 session
Product: [Applications] ktouch Reporter: Egor <Jaguar_e>
Component: generalAssignee: Sebastian Gottfried <sebastian.gottfried>
Status: CONFIRMED ---    
Severity: critical CC: dev, matija
Priority: NOR    
Version First Reported In: 24.05.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screenshot of KTouch falsely showing the error.

Description Egor 2021-03-19 18:36:45 UTC
SUMMARY
in wayland session KTouch return error about layots/
but in X11 session all works OK

STEPS TO REPRODUCE
1. start KTouch in wayland session(in system 2  layouts RU & US(by default))
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


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

ADDITIONAL INFORMATION
Comment 1 Matija Šuklje 2024-08-14 07:29:23 UTC
Created attachment 172614 [details]
Screenshot of KTouch falsely showing the error.
Comment 2 Matija Šuklje 2024-08-14 07:32:12 UTC
I can confirm this on EndeavourOS (Arch) for 24.05.1 and the German Neo2 layout on Wayland.

Please see attached a screenshot that shows that the layout selected is indeed Neo, and still KTouch falsely claims that the correct layout is English (USA).
Comment 3 Wismill 2025-05-28 19:12:34 UTC
I suspect that this is due to using the X11 API: https://invent.kde.org/education/ktouch/-/blob/35065a0b85b15c15fc42f205c1cbf265a30a3ee0/src/x11_helper.cpp#L227.

On Wayland, the layout *components* (layout, variant) are not set by KWin (nor any other compositor it seems).

The solution would be to use setxkbmap with the exact same config than set in Plasma config.