Ubuntu – Ubuntu 18.04 input slow when Portuguese (Brazil) layout among keyboard input sources


My system freezes for 1-2 seconds every time I need to input a password, most of the times when I start typing on the a new window or dash input and every time when I turn volume up/down through the keyboard. Probably it happens on other situations, but these are the most noticeable ones.

I am investigating it already for a long time and these are the conditions for it to happen:

  1. Ubuntu 18.04
  2. Gnome shell
  3. xorg display server
  4. Portuguese (Brazil) layout among input sources options

The problem doesn't happen if I:
1. use Ubuntu 16.04 Gnome
1. switch the interface to cinnamon or KDE on 18.04
1. switch to wayland on 18.04
1. remove Portuguese (Brazil) from input sources options

The weird thing is: if I am using English international input source it works well if and only if "Portuguese (Brazil)" is NOT among the options configured – if I add it, the problem happens even if I keep using the english input source config.

My system default language is english – maybe this is causing some kind of conflict. I don't want to use portuguese as system language because some names just get horrible (like "Área de Trabalho").

No useful info on syslog and already tried everything here: Keyboard input lag in Ubuntu 18.04 (looks like a different problem)

Do anyone have any tip that may help? I like cinnamon but not as much as gnome shell…

Thank you very much!

Best Answer

The comment below was the solution that worked for me. I found it at https://bugs.launchpad.net/ubuntu/+source/meta-gnome3/+bug/1777708 and the author of this answer is Pedro Palhares.

After being annoyed by this bug for a long time, i started digging and found a workaround. Today i found that the bug is only present when i'm using certain keyboard layouts ("Portugues (Brasil)") and was not present when i changed the layout to EUA and language to English (need to set them both to English).

After some digging i found out the culprit is the ScrollLock key and that can be fixed by editing the layout file, which in my case is found at /usr/share/X11/xkb/symbols/br. The only modification i did was to remove or comment the line: modifier_map Mod3 { Scroll_Lock }; After that, set the language and layout back to Portugues (Brasil) and the problem was gone!

No more delays between typings. (Fedora and Ubuntu)