Bug 454223 - Keyboard Layout keeps resetting to US when I click anywhere on screen
Summary: Keyboard Layout keeps resetting to US when I click anywhere on screen
Status: RESOLVED DOWNSTREAM
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keyboard (other bugs)
Version First Reported In: 5.24.4
Platform: Ubuntu Linux
: NOR major
Target Milestone: ---
Assignee: Plasma Bugs List
URL: https://unix.stackexchange.com/questi...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-22 16:41 UTC by stalkermar
Modified: 2022-12-11 21:12 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
screenshot 1 (71.13 KB, image/png)
2022-05-25 16:17 UTC, stalkermar
Details
screenshot 2 (98.53 KB, image/png)
2022-05-25 16:18 UTC, stalkermar
Details
screenshot 3 (86.55 KB, image/png)
2022-05-25 16:19 UTC, stalkermar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stalkermar 2022-05-22 16:41:00 UTC
SUMMARY

Im running Kubuntu. I've added multiple input languages, and I can switch between them just fine, when an input field is in focus. But, as soon as I click anywhere on screen, language switches back to US and keyboard shortcut to change languages stops working as well. It's extremely annoying, as I have to change language from English every time I try to type something.

STEPS TO REPRODUCE
1. Open any text editor
2. Switch language from US
3. Click anywhere

OBSERVED RESULT

Language switches back to US automatically.

EXPECTED RESULT

Input language should not switch automatically?

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Latest LTS Kubuntu 22.04
KDE Plasma Version: latest upstream
KDE Frameworks Version: latest upstream
Qt Version: latest upstream

ADDITIONAL INFORMATION

There's a ton of bugs like this, so I'm definitely not alone:
https://askubuntu.com/questions/1330324/kde-plasma-5-undesireable-keyboard-layout-switching-behavior

...but, I know this will never get fixed. So, I will not use KDE ever again. Gnome, here I come.
Comment 1 Nate Graham 2022-05-23 20:07:49 UTC
> There's a ton of bugs like this, so I'm definitely not alone:
First I've heard of it. Thanks for reporting it.

> ...but, I know this will never get fixed. So, I will not use KDE ever again. Gnome, here I come.
Does that mean that if I ask you questions to try to find out where the bug is, you won't be able to answer them?
Comment 2 stalkermar 2022-05-23 20:19:30 UTC
> ask you questions

That was just a joke, sorry. I'd be happy to cooperate and get the issue fixed.
Let me post some details bout my system to get started:

OS: Ubuntu 22.04 jammy
Kernel: x86_64 Linux 5.15.0-30-generic
Uptime: 0m
Packages: 2283
Shell: bash 5.1.16
Resolution: 1920x1080
DE: KDE 5.92.0 / Plasma 5.24.4
WM: KWin
GTK Theme: Breeze [GTK2/3]
Icon Theme: breeze-dark

Though it says Ubuntu, I actually started out at Kubuntu. I guess it was 20.04, a pretty old version. And then I've updated the distro a few times.

I've noticed that when text input is focused, I can actually switch languages. But when the desktop is in focus, it just gets stuck to US and there's nothing I can do. Even if I remove US from the list of input languages whatsoever.
Comment 3 stalkermar 2022-05-23 20:23:47 UTC
Here's more lines from about page.

Operating System: Kubuntu 22.04
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Kernel Version: 5.15.0-30-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-6700HQ CPU @ 2.60GHz
Memory: 31,3 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 960M/PCIe/SSE2
Comment 4 stalkermar 2022-05-23 20:36:42 UTC
It actually worked fine on 20.04, so your best bet would be to reproduce it like this:

1. Install Kubuntu 20.04
2. Add 1 more input language
3. Update the distro to 21.10. I guess I've used this manual: https://help.ubuntu.com/community/JammyUpgrades/Kubuntu
4. Reboot. 
5. Update to the "latest and greatest" distro- 22.10
6. Reboot
7. Observe the issue.

I don't think there's a big chance the bug will appear, but it might be worth giving it a try.
Comment 5 stalkermar 2022-05-23 20:48:07 UTC
(In reply to comment #4)

> 1. Install Kubuntu 20.04
> 2. Add 1 more input language

And while on 20.04, you might log out, switch to wayland, try to log in (it'll fail) and reboot. IDK if that's important.
Comment 6 Nate Graham 2022-05-24 16:15:27 UTC
Where exactly are you adding 1 more input language?
Comment 7 stalkermar 2022-05-24 16:30:19 UTC
(In reply to Nate Graham from comment #6)
> Where exactly are you adding 1 more input language?

System Settings - Input Devices - Layouts - Add - Japanese - OK - Apply
Comment 8 Nate Graham 2022-05-24 18:10:30 UTC
What do you have the "Switching policy" set to on that page?
Comment 9 stalkermar 2022-05-24 18:29:40 UTC
(In reply to Nate Graham from comment #8)
> What do you have the "Switching policy" set to on that page?

Global. It changes nothing, though. The bug is still there when I switch to the different one.
Comment 10 Andrey 2022-05-24 19:43:49 UTC
Do you have some ibus stuff installed maybe?
Comment 11 stalkermar 2022-05-24 20:04:28 UTC
(In reply to Andrey from comment #10)
> Do you have some ibus stuff installed maybe?

Not that I know of. At the very leasy, ibus package from apt is not installed.
Comment 12 Andrey 2022-05-24 20:15:14 UTC
(In reply to stalkermar from comment #0):
> https://askubuntu.com/questions/1330324/kde-plasma-5-undesireable-keyboard-
> layout-switching-behavior
Did you try to follow the tips suggested?
Comment 13 Andrey 2022-05-24 20:16:32 UTC
(In reply to stalkermar from comment #4)
> It actually worked fine on 20.04, so your best bet would be to reproduce it
> like this:
> 
> 1. Install Kubuntu 20.04
> 2. Add 1 more input language
> 3. Update the distro to 21.10. I guess I've used this manual:
> https://help.ubuntu.com/community/JammyUpgrades/Kubuntu
> 4. Reboot. 
> 5. Update to the "latest and greatest" distro- 22.10
> 6. Reboot
> 7. Observe the issue.

So it might be upgrade issue, can you reproduce yourself in VM?
Comment 14 Andrey 2022-05-24 20:19:03 UTC
(In reply to stalkermar from comment #3)
> Graphics Platform: X11
What's on Wayland?
Comment 15 stalkermar 2022-05-24 20:42:09 UTC
I've managed to determine what's causing the issue.
There was a widget called Input Method. And as soon as I removed it from the panel, everything just started working again. I'm sure I didn't add it, the thing have just appeared on me after the update. No matter how many times I close it, the thing just re-appears after a reboot.

When I click on a desktop, it's tooltip says "No input window". And I can't switch the language.
But when I click on any input field, it changes to "Keyboard - English (US)" and I can start typing.

Some of the most annoying cases (for those who think this is intended behavior):
1. Address bar in Chrome changes language every time I press backspace
2. VS Code changes language every time I click on the text

When I click on the Configure option of the widget, I get the following error message (and nothing happens):
"You're currently running KDE, but KCModule for fcitx couldn't be found, the package name of this KCModule is usually kcm-fcitx or kde-config-fcitx. Now it will open config file with default text editor."

"Online Help" option of the widget leads into nowhere (nothing happens as well).

I guess it's somehow connected to the virtual keyboard I didn't know existed and I've never used in my life. I wonder if this is an intended behavior (and how do I get rid of it).
Comment 16 Andrey 2022-05-24 22:15:15 UTC
(In reply to stalkermar from comment #15)
> There was a widget called Input Method. And as soon as I removed it from the
> panel, everything just started working again. I'm sure I didn't add it, the
> thing have just appeared on me after the update. No matter how many times I
> close it, the thing just re-appears after a reboot.
Input Method is the usual source of such problems.
But I completely unaware how it was introduced and why it re-appears.
You can try forcibly disable the applet in Systray settings.
Comment 17 stalkermar 2022-05-25 08:36:27 UTC
> You can try forcibly disable the applet in Systray settings.

There's no way to do that, though. There's no delete button, only "Show when relevant" or "Always hidden". In case I hide it, the issue persists. So, I have to right click the widget and click "Exit" every time I turn on my laptop.
Feels bad, man. Hope it's fixable.
Comment 18 Andrey 2022-05-25 09:22:25 UTC
(In reply to stalkermar from comment #17)
> > You can try forcibly disable the applet in Systray settings.
> 
> There's no way to do that, though. There's no delete button, only "Show when
> relevant" or "Always hidden". 
It's strange as I have one: "Disabled" for the IM applet.
BTW, are you able to attach the files here? Wanted to attach the screenshot but couldn't.
Comment 19 Nate Graham 2022-05-25 14:58:23 UTC
Can you take a screenshot of the IM applet in your system tray so we can be sure what it is?
Comment 20 stalkermar 2022-05-25 16:17:20 UTC
Created attachment 149211 [details]
screenshot 1
Comment 21 stalkermar 2022-05-25 16:18:02 UTC
Created attachment 149212 [details]
screenshot 2
Comment 22 stalkermar 2022-05-25 16:19:04 UTC
Created attachment 149213 [details]
screenshot 3

And a screenshot #3. Man, this GUI is so outdated. I wish it would allow to drag and drop multiple files in 1 go. It feels like I'm back in the 90s
Comment 23 Andrey 2022-05-25 20:08:32 UTC
(In reply to stalkermar from comment #22)
> Created attachment 149213 [details]
> screenshot 3
> 
> And a screenshot #3. Man, this GUI is so outdated. I wish it would allow to
> drag and drop multiple files in 1 go. It feels like I'm back in the 90s

We see two IM applets, maybe that is the problem? Can you disable at least one?
Comment 24 stalkermar 2022-05-26 10:39:44 UTC
(In reply to Andrey from comment #23)
> We see two IM applets, maybe that is the problem? Can you disable at least one?

The one that's causing the problem cannot be disabled. There's no such option. And disabling the other one gives no effect.
Comment 25 Andrey 2022-05-26 11:01:28 UTC
As I only have one IM applet, I wonder if the other one was left after upgrade.
Can you check on new install?
Comment 26 stalkermar 2022-05-26 11:07:07 UTC
(In reply to Andrey from comment #25)
> new install?

No, thank you. I know it's possible to fix issues like this by reinstalling my system, but I'm not doing that.
Comment 27 Andrey 2022-05-26 11:10:19 UTC
I'm not suggesting to reinstall your system but rather try in on VM, so we would know what upgrade path producing it, if any.
Comment 28 Nate Graham 2022-05-26 16:17:47 UTC
It's confusing because there is a 1st-party applet called "Input Method" that is used to control the Maliit virtual keyboard. You appear to have a second applet which has the same name, but does different things. As far as I can tell, that second one is a 3rd-party applet that's not developed by KDE, so I would recommend that you contact its developers and inform them of this issue. Thanks!
Comment 29 ptkory 2022-12-11 20:01:43 UTC
Hi, I just searched everywhere online and I am having the same issue. The exiting of "Input Method" in the system tray does work as a workaround for this issue. Once the "Input Method" is closed, everything works as intended. 

I have also upgraded from Kubuntu 20.04 to 22.04, so it must be an upgrade issue. This was driving me nuts, but at least we have a workaround available. I've found this a little while later, which might be related: https://unix.stackexchange.com/questions/529822/kde-how-to-get-rid-of-ibus-keyboard-selector

I did have zoom installed on 20.04 (before the upgrade), which I uninstalled on 22.04. This might be related, as ibus seems to be a dependency for zoom. 

I'm also having this issue, where the terminal changed to a secondary language after adding a second language: https://askubuntu.com/questions/1407214/adding-language-failure-in-terminal-and-system-kde-kubuntu
I had to modify this file "~/.config/plasma-localerc" and set it back to get the default english terminal language back.
[Translations]
LANGUAGE=en_US

Upgrading to 22.04 is really not going well for me as I have other issues to look through.
Comment 30 Andrey 2022-12-11 21:12:06 UTC
(In reply to ptkory from comment #29)
> I have also upgraded from Kubuntu 20.04 to 22.04, so it must be an upgrade
> issue. This was driving me nuts, but at least we have a workaround
> available. I've found this a little while later, which might be related:
> https://unix.stackexchange.com/questions/529822/kde-how-to-get-rid-of-ibus-
> keyboard-selector
Thanks. Coexisting with IM/IBus is not very well tested, so might produce unexpected results like this.

> I'm also having this issue, where the terminal changed to a secondary
> language after adding a second language:
> https://askubuntu.com/questions/1407214/adding-language-failure-in-terminal-
> and-system-kde-kubuntu
> I had to modify this file "~/.config/plasma-localerc" and set it back to get
> the default english terminal language back.
> [Translations]
> LANGUAGE=en_US
Could you check if it's reported and if not, make a report?

> Upgrading to 22.04 is really not going well for me as I have other issues to
> look through.
Usually we try to carry about the upgrade paths, so you are welcome to report all the bugs you found.