Bug 379930

Summary: kcm_keyboard kills ibus daemon, entirely breaking the keyboard
Product: [Applications] systemsettings Reporter: Ralf Jung <post>
Component: kcm_keyboardAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED FIXED    
Severity: critical CC: aria, kde, silver.salonen, spamme, tech
Priority: NOR    
Version: 5.8.6   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.11.0
Sentry Crash Report:
Attachments: A patch fixing the issue
Better patch wich remove the function and the only place it’s called

Description Ralf Jung 2017-05-17 07:57:36 UTC
I was having some trouble setting up ibus, which I first attributed to bugs in ibus itself:  ibus would not start automatically (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=862721) and would sometimes quit on suspend-resume (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=862717).  However, since then, I have noticed that the following line appears in .xsession-errors every time ibus breaks:

  org.kde.kcm_keyboard: ibus successfully stopped

The result of this is that keyboard input does not work -- effectively making the machine unusable.

I assume there is/was a good reason for kcm_keyboard to kill the ibus daemon, but right now, the net effect of this behavior is rather catastrophic.  As far as I can tell, the only possible "fix" for me is to uninstall ibus :/
Comment 1 Ralf Jung 2017-05-17 09:11:16 UTC
I verified that changing XkbHelper::preInitialize to not do anything fixes the ibus-daemon trouble, at least as far as automatically starting it on launch is concerned.
Comment 2 Ralf Jung 2017-05-19 08:12:21 UTC
Created attachment 105624 [details]
A patch fixing the issue

Just for reference, I attached the patch I used to fix the issue.
Comment 3 Ľudovít Lučenič 2017-07-04 20:59:57 UTC
This bug affects me a lot on debian 9 stretch. Without IBus running automatically many applications (Firefox, Sublime Text, ..) print dead keys (accents) straight instead of composing them with following letter: I get ´a instead of á.

When this fix may be published, please?
Comment 4 ariasuni 2017-07-23 03:38:52 UTC
This is another bug caused by the same piece of code: https://bugs.kde.org/show_bug.cgi?id=359109

I’ll recap:

* kcm_keyboard is killing ibus at startup, when editing keyboard configuration, or when switching back from TTY. «stop ibus so it does not mess with our layouts»[1] but when is kill user applications a good thing?
* Killing ibus leaves text fields of KDE (not Qt-only or GTK or all other ones) apps completely unusable even after restarting ibus: I need to relaunch krunner, konsole, konversation to name a few applications.
* I built myself Plasma to test if there was any problem if removing the code that kills ibus then editing layouts and such, and there are apparently none. This code is probably just useless now.

So can you please remove this 20-line nightmare? It would be much better for a ton of users, and it involves a very minimal, trivial modification.

[1]: <https://cgit.kde.org/plasma-desktop.git/commit/?id=d322ea9051c79a5d9a5eb7b48eccba54b80fa944>
Comment 5 ariasuni 2017-07-23 03:41:18 UTC
Created attachment 106790 [details]
Better patch wich remove the function and the only place it’s called

Here is a patch that works against latest Plasma master (anyway the code in question has not changed in ages), all it does is removing the function dedicated to killing ibus and remove the only place it’s called.
Comment 6 Christoph Feck 2017-07-27 20:40:21 UTC
Please submit patches using https://phabricator.kde.org/differential/diff/create/
Comment 7 ariasuni 2017-07-27 23:15:04 UTC
Well that wasn’t easy but here we are: https://phabricator.kde.org/D6956
Comment 8 Christoph Feck 2017-08-02 09:53:38 UTC
*** Bug 359109 has been marked as a duplicate of this bug. ***
Comment 9 Ralf Jung 2017-08-02 17:52:50 UTC
Thank you for taking this on. :)
Comment 10 Silver Salonen 2017-10-02 07:01:37 UTC
*** Bug 376966 has been marked as a duplicate of this bug. ***