Bugzilla – Bug 1226387
[KDE] Configuring keyboard layout with yast doesn't survive reboot
Last modified: 2024-06-25 15:03:29 UTC
Created attachment 875502 [details] keyboard config My system is configured with an AZERTY (fr) keyboard and in the FRENCH language. SDDM and KDE take this into account, so I have no problem logging in. On the other hand, Yast2 software is systematically in QWERTY after a reboot. The same goes for the Vivaldi address bar. Yast2-Keyboard solves the problem temporarily, as does localectl fr. Adding KEYTABLE="en" and XKB_LAYOUT="en" to /etc/sysconfig/keyboard has no effect. I've been using Plasma 6 and Wayland since it came out and I had no such problems with Leap 15.5. I have no idea what caused this bug after upgrading to leap 15.6. Operating System: openSUSE Leap 15.6 KDE Plasma Version: 6.0.5 KDE Frameworks Version: 6.3.0 Qt Version: 6.7.1 Kernel Version: 6.4.0-150600.21-default (64-bit) Graphics Platform: Wayland Processors: 8 × 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz Memory: 15.4 Gio of RAM Graphics Processor: Mesa Intel® Xe Graphics Manufacturer: Notebook Product Name: NLx0MU
This appears to be a duplicate of bug #1225991. In that case, it was GNOME, but it is entirely possible that the real problem lies deeper, so KDE Plasma might also be affected. Please read comment #11 .. comment #21 in that bug. Does that sound familiar? If you experiment with different applications using different widget toolkits, do they behave as different as in that other bug? What about xterm (ancient X11 Athena widgets), Firefox (Gtk), the YaST Qt control center (pure Qt)? Does using the KDE Plasma keyboard switcher applet change the behavior?
Hello, I continued my investigations into this oddity over the weekend. As the configuration files mention a French azerty keyboard, and only certain applications are affected under Wayland, I came to suspect a problem with Xwayland. I tested under plasma-x11 and everything is in azerty. I have deduced that the problem lies in the transition from sddm (x11) to wayland. Unfortunately I couldn't go any further. On reading bug 1225991, comment #20 by Iakov Karpov immediately caught my attention, as it describes and explains the situation I'm facing. Iakov Karpov gives an analysis of the problem in bug 1226347 which describes the problem in a familiar way. Bug 1222754 also seems to me to be a duplicate. I've come to the conclusion that Yast2-keyboard does the job properly, even if not all the French keyboard variants are offered (mine is fr-oss or Français (variante) pour kde). The /etc/X11/xdm/keytable script could be to blame if it only executes when wayland is launched For information, under wayland when I launch : - xterm -> qwerty - Firefox -> azerty - Vivaldi -> qwerty - Yast2 ncurses en Konsole -> azerty - Yast2 Qt -> qwerty In the meantime I'm using plasma-x11, which runs like clockwork, so there's no urgent need to fix this bug. Thank you very much for your work and good luck with this bug.
(In reply to Olivier Belleux from comment #2) > - Yast2 ncurses en Konsole -> azerty > - Yast2 Qt -> qwerty YaST is called with root permissions. It probably depends either how you login/switch to root and how you call YaST. If you ssh to the machine as user and run sudo, then it probably uses the client keyboard. If you login as root to the console, then it's taken from the root settings. If you start it through X session, then it may use the users' settings.
(In reply to Lukas Ocilka from comment #3) > (In reply to Olivier Belleux from comment #2) > > - Yast2 ncurses en Konsole -> azerty > > - Yast2 Qt -> qwerty > > YaST is called with root permissions. It probably depends either how you > login/switch to root and how you call YaST. > > If you ssh to the machine as user and run sudo, then it probably uses the > client keyboard. If you login as root to the console, then it's taken from > the root settings. If you start it through X session, then it may use the > users' settings. I don't use SSH, so no problems there . > YaST is called with root permissions. It probably depends either how you > login/switch to root and how you call YaST. Under wayland, in a Konsole: yast2 --qt -> azerty sudo yast2 --qt -> azerty sudo yast2 --ncurses-> azerty Under Wayland in krunner: yast2 -> qwerty (kde ask for root password) Under X11, it's azerty everywhere. I've tried to connect to the root account under x11 and wayland and I get the same results. Except that the root account is in English and KDE refuses to display it in French, even though this is the language selected. The same goes for Yast2-language. For me there is something happening between SDDM and Wayland that is messing things up. I was using plasma 6 - wayland under leap 15.5 and none of this was happening. So logically it's a new feature introduced under leap 15.6, like the /etc/X11/xdm/keytable script that Iakov Karpov has criticised. Or something similar.
I've just done a search about Vivaldi and Wayland. https://wiki.archlinux.org/title/Vivaldi mentions that X11 is the default one but that it can be override by selecting auto in chrome://flags, Preferred Ozone platform. I tried this in Wayland and Vivaldi now uses an azerty keyboard. So under wayland, it is correctly detected and the locales are correctly taken into account by vivaldi. Another proof that the bug is on Xwayland's side ?
I continued my search for bugs involving Xwayland and found this one https://gitlab.freedesktop.org/xorg/xserver/-/issues/1052 Under wayland, I launched Yast from krunner; it is in qwerty. – In konsole as root (su + password) I did : export QT_QPA_PLATFORM=wayland ; yast2 --qt – And there, pleasant surprise, it is in azerty. A little extra progress.
Olivier, thank you for those additional details. So AFAICS we have a really bad mixture of X11 vs. Wayland problems (and maybe display manager, too) and the desktops no longer importing settings from the system to the initial user account being created. As a user, I find that disappointing; it worked for countless years, and now it was decided to no longer do this. Sure, Linux is a multi-user system, but to all intents and purposes, most installations have one single user, and that user is sitting on the system console, and installed the system previously where language and keyboard were already selected. We can only hope that our users find the subtle buttons in various places in the display manager or in some system tray applet or some desktop-specific configuration dialogs where they can set the keyboard again (to what they already selected during installation). IMHO they shouldn't need to do that. But it is what it is.
Reference: SLE-15-SP5 Admin Guide -> HW configuration -> Keyboard (no SP6 yet, and the Leap 15.6 docs are not nearly as detailed) https://documentation.suse.com/sles/15-SP5/html/SLES-all/sec-yast-hw-keym.html Files: /etc/vconsole.conf (for text consoles) /etc/X11/xorg.conf.d/00-keyboard.conf (for X11) /etc/sysconfig/keyboard (details like autorepeat rate etc.)
I just tried with my Tumbleweed VM directly after a "sudo zypper dup", so it has all the latest versions of everything: I can still change keyboard layouts just fine with "yast2 keyboard" (running as root) from the Xfce (running on X11) desktop logged in as a normal non-privileged user. I changed between the German and the US keyboard layout. Both /etc/vconsole.conf and /etc/X11/xorg.conf.d/00-keyboard.conf contain my chosen keyboard as expected, and I get correct keys.
(In reply to Stefan Hundhammer from comment #9) > I just tried with my Tumbleweed VM directly after a "sudo zypper dup", so it > has all the latest versions of everything: > > I can still change keyboard layouts just fine with "yast2 keyboard" (running > as root) from the Xfce (running on X11) desktop logged in as a normal > non-privileged user. I changed between the German and the US keyboard layout. > > Both /etc/vconsole.conf and /etc/X11/xorg.conf.d/00-keyboard.conf contain my > chosen keyboard as expected, and I get correct keys. Stefan, thanks for your help. I was able to (re)set the correct configuration by editing /etc/vconsole.conf and /etc/X11/xorg.conf.d/00-keyboard.conf (Option "XkbLayout" "fr" and Option "XkbVariant" "oss") so that I have an azerty keyboard with the correct glyphs at the other levels. Under X11 this works; however under wayland the X11 applications launched in Xwayland use the default US qwerty configuration. This is clearly a bug in xwayland that manifests itself in leap 15.6, probably due to a version change in one or more packages. So Yast2 keyboard isn't to blame, apart from the fact that it doesn't offer the oss variant. This bug may be marked "resolved". Thanks for your time.
OK, thanks for letting us know. For the sake of completeness: I just installed a fresh Leap 15.6 with English as the installation language and US English as the installation keyboard layout with the KDE Plasma system role (which uses X11) and auto-login (not sure if this is significant; how much the display manager is still involved then). The desktop starts up with the US keyboard, of course, as expected. Using YaST to change to the German keyboard layout worked fine; 'localectl', /etc/vconsole.conf and /etc/X11/xorg.d/00-keyboard.conf were all in agreement that it was the German keyboard, and it survived a reboot. In the KDE Plasma control center I can see that in "Input Devices" -> "Keyboard" -> Tab "Layouts" the "[ ] Configure Layouts" checkbox is unchecked, so it falls back to the system keyboard layout; which is what most users probably want. If I check this, I see a first line in the list with the German layout; which is also a good starting point when that was your previous Choice. Everything fine so far. And here comes a glitch in The Matrix: Switching to a text console (Ctrl-Alt-F1) STILL gave me a US keyboard (?!?). 'sudo loadkeys de' fixed it, but it made me suspicious WTH is going on. Something is still rotten. But I agree: There appears to be a problem with xwayland and the keyboard.