Keyboard layout in Wayland doesn't work correctly

Hello mates,

I’m on a fresh Fedora KDE 36 install and I have an international english keyboard but I like to type in brazilian portuguese sometimes, so I always set two keyboard layouts so that I can switch when needed, US international and brazilian ABNT2.

ABNT2

I tried setting the different keyboard layout in Plasma Settings but the only key that was being recognized was Ç.
I searched on the internet and I saw a command that could fix it:

setxkbmap -model abnt2 -layout br -variant abnt2

And it did work, but it didn’t persist across reboot, so I searched on the Fedora’s docs and the right command was:

localectl set-keymap br-abnt2

But that didn’t work either, locale.conf seems to be right, as well as vconsole.conf, but the only key working from the ABNT2 layout was still Ç and it made it worse since now the first command also doesn’t work anymore.

However I found out that the keyboard layout is working on X11 Plasma and it’s working on another TTY console, the problem is restricted only to Wayland.
I’m typing in brazilian portuguese on X11:

Acentuação; Olá, Olé, Bebê, Robô, Córtex, Poções, Lingüiça (antigo), Às três

Is there another command to change the layout or is it a Wayland bug and I should report it.

2 Likes

While I do not have your config the description, and the fact that things work properly under xorg but not wayland seems to indicate it is wayland related.

I would suggest at least filing the bug under wayland and let the developers sort it out.

Have a look at 2076596 – The KDE ibus panel is not able to switch keyboard layouts on Wayland

And see if it’s the same issue.

Thanks.

1 Like

Hi,

I have the same issue since an installation by updates of Gnome 4.1 on my system. Locale is set correctly to language EN, using FR keyboard (azerty). All input past the logon screen is in qwerty. Changing the options in gnome settings do not “stick” on screen but seem to be applied. However the problem is always the same past logon screen, the keyboard is always in qwerty (en).
I am running Nvidia on X11 and not on wayland …

loginctl show-session (sessionid) -p Type
Type=x11

Device-1 NVIDIA GK104 [GeForce GTX 760]
vendor Micro-Star MSI
driver nvidia 12v 470.103.01
bus-ID 01:00.0
Display x11 server X.Org v 1.20.14 driver X
loaded nvidia
unloaded fbdev,modesetting,nouveau,vesa gpu nvidia,nvidia-nvswitch
resolution 1920x1080~60Hz
OpenGL renderer NVIDIA GeForce GTX 760/PCIe/SSE2 v 4.6.0 NVIDIA 470.103.01
direct render Yes

System Locale: LANG=en_GB.UTF-8
LC_NUMERIC=fr_FR.UTF-8
LC_TIME=fr_FR.UTF-8
LC_MONETARY=fr_FR.UTF-8
LC_PAPER=fr_FR.UTF-8
LC_MEASUREMENT=fr_FR.UTF-8
VC Keymap: fr-azerty
X11 Layout: fr
X11 Variant: azerty

Best regards,
Patrick.

When I boot the system I have the same problem.
I have an invisible icon in the system tray called IBus, if I close it my layout English (intl., with AltGr dead keys) starts to work well again!

So probably @joe is right, and 2076596 – The KDE ibus panel is not able to switch keyboard layouts on Wayland is the issue for me!

1 Like

Hello again mates, the bug is indeed that IBUS panel one as @grumpey and @cirelli94 pointed out, closing ibus panel fixes the issue on firefox.

I was not sure what ibus was even used for so I just uninstalled it (and everything that required it) to see what it would break and firefox worked as intended in portuguese but XWayland applications like ferdi didn’t produced decomposed characters (combined characters with accents) like intended, so perhaps that is the issue here.

I guess ibus is needed so that XWayland windows produce these decomposed characters but it’s blocking the keys used to produce them on Wayland windows.

The images bellow explains what decomposed characters are, which are activated by some ISO Level1 and Level2 keys, marked in red on the keyboard layout for brazilian portuguese, while ISO Level3 and Level 4 green ones don’t produce decomposed characters and were working as intended.

cmletters

Also, after uninstalling and reinstalling ibus, it looks like the bug went away if I close ibus and run the , it’s working as intended without needing to close the Ibus Panel, perhaps there’s some configuration file left behind during development that was messing with it’s function, it was erased while uninstalling and now it’s all fine.

I set Ibus Panel to use the system’s layout and everything works now.

EDIT: you still need to close Ibus panel and start ibus-daemon from terminal so that it works, but it’s better than before.

acentuação, olá, olé, bebê, robô, córtex… all in wayland and also in xwayland.

Hi Cirelli94,
I’m running X11 and ibus-daemon and I find that although my localectl is ok, the only setting helping me get the keyboard ok is the command:

setxkbmap -model PC105 -layout fr -variant azerty

In ibus-panel or gnome settings, there is no keyboard data displayed in input sources (no English; no French). Like higher up in the post locale.conf and vconsole.conf are ok. I don’t see any icon for keyboard setting on my system tray either. As I don’t use KDE, already have the ibus-daemon running, don’t use wayland, I think the problem is still around ibus but not limited to wayland. Any ideas ? Thanks. Patrick.

:grimacing: I’m sorry I don’t have any other ideas!

If you try to pkill ibus-daemon?