SUMMARY I added pt-br and US keyboard layouts in Keyboard KCM. If the active keyboad layout before logout is pt-br, Plasma always changes it to US when I start a new Wayland session. STEPS TO REPRODUCE 1. add US and pt-br keyboard layouts in Keyboard KCM 2. use the keyboard layout icon in systray to activate the pt-br layout 3. restart Wayland session OBSERVED RESULT after relogin, active keyboard layout is US EXPECTED RESULT active keyboard layout should be the same as before logout (pt-br in this case) SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 5.16.90 KDE Frameworks Version: 5.62.0 Qt Version: 5.13.1
Wayland session always uses the first keyboard layout listed in "layouts" tab of the "Keyboard" kcm. Operating System: Arch Linux KDE Plasma Version: 5.17.0 KDE Frameworks Version: 5.63.0 Qt Version: 5.13.1
KeyboardDaemon seems to be depended on X11 rather closely: https://invent.kde.org/plasma/plasma-desktop/-/blob/master/kcms/keyboard/keyboard_daemon.cpp#L54 That is why layout saving doesn't work on Wayland, as well as country flag indicator, etc. So we need either "untie" it from X11 somehow or re-implement/move parts of it in KWin.
MR: https://invent.kde.org/plasma/kwin/-/merge_requests/38
The feature was not implemented so it's not related with 423039 bug. Removing.
Please test and report as it's still might be a problems
This issue persists. Operating System: KDE neon Unstable Edition KDE Plasma Version: 5.19.80 KDE Frameworks Version: 5.73.0 Qt Version: 5.14.2
Note that for some reason (see the merge request) this only saves if session restore is on. I would welcome feedback on that.
I have enabled session restore, switched to the second keyboard layout listed in "Layouts" tab of Keyboard kcm, rebooted (currently logout fails because a supposedly fixed kwin_wayland crash - bug 420077 - that persists). The kayboard layout activated before reboot was not remembered.
Hi Patrick, thanks for testing. For now you probably need to compile Plasma yourself or try some sort of unstable Plasma distribution (for example, Neon). Please note "Version Fixed In: 5.20" above. If you already did it, let's try together to make it work for you.
as you can read in comment 6, I'm using neon unstable.
Still, it has KDE Plasma Version:5.19.80 instead of needed 5.20, isn't it?
5.19.80 is git master
I'm not an expert in Neon but perhaps it doesn't build immediately on every commit. What I can see is the current unstable version named neon-unstable-20200719-1102.iso and the patch was merged Jul 20'th https://invent.kde.org/plasma/kwin/-/merge_requests/38#note_76678, might it be the reason?
(In reply to Andrey from comment #13) > I'm not an expert in Neon but perhaps it doesn't build immediately on every > commit. > What I can see is the current unstable version named > neon-unstable-20200719-1102.iso and the patch was merged Jul 20'th > https://invent.kde.org/plasma/kwin/-/merge_requests/38#note_76678, might it > be the reason? kwin_wayland package was updated 3 times on my neon unstable installed on hard disk since my previous comment. This bug persists. :(
I think we still need to find a way to make sure the patch is there. After that I'll try Neon myself, so let me know if you find it first. Thanks for helping.
Seems it's there: https://build.neon.kde.org/view/3%20unstable%20%E2%98%A3%20git%20master/job/bionic_unstable_kde_kwin/707/changes I'll have a look.
(In reply to Patrick Silva from comment #8) > I have enabled session restore, switched to the second keyboard layout > listed in "Layouts" tab of Keyboard kcm, rebooted (currently logout fails > because a supposedly fixed kwin_wayland crash - bug 420077 - that persists). Looking at the code seems like that crash might be the reason. I could provide workaround, but proper fix would be eliminating the crash. I suspect even when you reboot, that crash occurs, so kwin just can't be in time to save the layout. Could we somehow terminate session without the crash?
(In reply to Andrey from comment #17) > (In reply to Patrick Silva from comment #8) > > I have enabled session restore, switched to the second keyboard layout > > listed in "Layouts" tab of Keyboard kcm, rebooted (currently logout fails > > because a supposedly fixed kwin_wayland crash - bug 420077 - that persists). > > Looking at the code seems like that crash might be the reason. > I could provide workaround, but proper fix would be eliminating the crash. > I suspect even when you reboot, that crash occurs, so kwin just can't be in > time to save the layout. > Could we somehow terminate session without the crash? Can you reproduce the kwin_wayland crash on logout?
(In reply to Patrick Silva from comment #18) > Can you reproduce the kwin_wayland crash on logout? Yes, I reported it here: https://bugs.kde.org/show_bug.cgi?id=420077#c5
Since the crash bug 420077 we depend on is fixed now I'm closing this, feel free to reopen in case of any problems. If testing on Neon, make sure the relevant commit is built in: https://build.neon.kde.org/view/3%20unstable%20%E2%98%A3%20git%20master/job/bionic_unstable_kde_kwin/changes
Hi Patrick, have you been able to test it since then? Your feedback is welcomed :)
Hi Andrey Finally the annoying kwin_wayland crash on logout is fixed. \o/ Thank you. However, the issue reported here is not completely fixed. After I restart Wayland session, keyboard layout applet in system tray indicates that the first keyboard layout listed in Keyboard kcm is in use. Then I press any key and OSD appears on the screen to indicate that the keyboard layout changed to the one activated before logout. Operating System: KDE neon Unstable Edition KDE Plasma Version: 5.19.80 KDE Frameworks Version: 5.74.0 Qt Version: 5.14.2
Thanks for your feedback Patrick! Could you clarify what keyboard layout applet you are talking about? It would be fine to take a screenshot, if possible. The one showing layout in system tray on Wayland currently uses IBus and unrelated with the way layout handled in kwin (XKB). So when you on X11 you probably see another layout applet in action. That is the separate issue which needs to be dealing with. PS: if possible, please also test the case with Application Policy for keyboard layouts - it might be some quirks there.
Created attachment 130784 [details] screenshot I'm attaching a screenshot showing the keyboard layout applet. Application policy is also not working. I activate the second layout and Plasma reverts to the first one when I press any key.
That applet should work, I'll see. Thanks. About Application policy, isn't it the way it works? It remembers layouts for different windows separately, so it won't change in another window until you change it there.
I open Kate and change the layout via systray applet. When I start to type in Kate, Plasma reverts to the previous layout.
Hi Patrick, I've checked and this actually is not a regression. Actually it works, you just switched panel layout with the applet, instead of layout of the app. To switch app's layout with the applet when Application policy is active, we need to prevent focus stealing by panel. It could be achieved by setting Keyboard Layout applet to "Always Shown" in Configure System Tray/Entires tab. Please, try it yourself and report back :) About the issue with first layout indication, would you like to file a separate bug? I'll try to fix it if possible.
(In reply to Andrey from comment #27) > Hi Patrick, > I've checked and this actually is not a regression. > Actually it works, you just switched panel layout with the applet, instead > of layout of the app. > To switch app's layout with the applet when Application policy is active, we > need to prevent focus stealing by panel. It could be achieved by setting > Keyboard Layout applet to "Always Shown" in Configure System Tray/Entires > tab. > Please, try it yourself and report back :) you are right about yhat. Aplication policy works in the same way on X11. > About the issue with first layout indication, would you like to file a > separate bug? I'll try to fix it if possible. I will open another report later. Is intentional the fact that keyboard layout is only remembered on Wayland when session restore is enabled?
Thanks, please include me in CC then. Yes, it was intentional. Some people agree with it and some not. See MR above for the details.
(In reply to Patrick Silva from comment #28) > I will open another report later. > https://bugs.kde.org/show_bug.cgi?id=425343 Feel free to amend or mark as duplicate, as you see appropriate.
(In reply to Patrick Silva from comment #28) > (In reply to Andrey from comment #27 > > About the issue with first layout indication, would you like to file a > > separate bug? I'll try to fix it if possible. > I will open another report later. already reported by another user a fev months ago as bug 418699
(In reply to Patrick Silva from comment #31) > already reported by another user a fev months ago as bug 418699 That seems another issue to me, but thanks.
(In reply to Patrick Silva from comment #22) > However, the issue reported here is not completely fixed. > After I restart Wayland session, keyboard layout applet in system tray > indicates that the first keyboard layout listed in Keyboard kcm is in use. Hi Patrick. It's fixed now in bug 425343. Please test and report back there!
*** Bug 485635 has been marked as a duplicate of this bug. ***
It seems to have regressed. Tested on 6.0.3 and master (see Bug 485635).
In the ~/.config/kxkbrc file, there should be "LayoutDefault" entry. Could you check if it's overwritten on the session logout?
I have a "LayoutDefaultGlobal" entry, but it is not overwritten at logout. It does work if I set it manually though.
Maybe we have stale KWin process? Can you make sure there is no kwin and other Plasma processes in the system immediately after logout? I also saw some bug reports about lost KConfig configuration recently, might be related.
(In reply to Andrey from comment #39) > Maybe we have stale KWin process? > Can you make sure there is no kwin and other Plasma processes in the system > immediately after logout? I tried to check this with htop in TTY and could not detect Plasma processes. But this method does not seem reliable if I am not fast enough.