Bug 376966

Summary: Keyboard input does not work for some applications
Product: [Plasma] plasmashell Reporter: Silver Salonen <silver.salonen>
Component: generalAssignee: David Edmundson <kde>
Status: RESOLVED DOWNSTREAM    
Severity: normal CC: alpha0x89, bhush94, mtmkls, nate, patrick.rudolph, plasma-bugs, rprots
Priority: NOR    
Version: 5.9.2   
Target Milestone: 1.0   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Silver Salonen 2017-02-26 21:14:18 UTC
Keyboard input in some KDE applications just does not work sometimes.
2 certain applications where it does not work during every session are:
  - The menu widget (does not matter whether Application Launcher or Application Menu) - in there the first letter is reflected, but after no more letters are accepted.
  - Alt+F2 launcher - no input works whatsoever

It seems that it's most likely so for any KDE applications that are started at session startup (eg. Konsole from the last session). I have not seen this problem in any non-KDE applications (Thunderbird, LibreOffice, VLC, terminal applications, ...).

I have had this problem already like a year or so, but have been just living with it (work-arounds like copy-pasting phrases written in some other application). Also, some weeks ago I upgraded to some beta release by accident (when playing around with repositories) and in there the problem was gone, but as soon as I downgraded to stable release again, it re-appeared.
Comment 1 Roman Prots' 2017-03-15 07:48:48 UTC
Problem gets reproduced on 5.8.5 version.
Comment 2 Roman Prots' 2017-03-15 07:51:03 UTC
Might be related: https://bbs.archlinux.org/viewtopic.php?id=216797
Comment 3 Silver Salonen 2017-03-15 07:54:53 UTC
One interesting nuance I've noticed lately is that after logging in KWallet password prompt input works only a while - if I enter my password within 5 seconds or so then it works, but after that not anymore. Also, it sometimes happens in Konsole that input works in the newly opened window for some time, but then stops working. I then need to open a new window.
Comment 4 Roman Prots' 2017-03-15 08:06:10 UTC
Similar behavior from my side.
When konsole starts right after login automatically I can't type into it. If closing it and opening again it works.
Comment 5 Patrick Rudolph 2017-05-10 12:30:53 UTC
The problem was observed on 5.8.6 with the following two applications:

* Konsole application
* Alt + F2 launcher

All other applications accepted keyboard input.
There's no information whether or not the application was autolaunched by KDE.

Closing the Konsole application and starting a new one fixed the problem.
Comment 6 Theo 2017-10-01 16:28:52 UTC
I have this problem on openSUSE Tumbleweed, KDE Plasma 5.10.5. Keystrokes are registered only sporadically in all KDE applications as described in https://bugs.launchpad.net/ubuntu/+source/kubuntu-settings/+bug/1633721 (that bug seems to be about input fields only, though). This happens often after my system has been stalled when running out of memory. Once my system is responding again, the IBus daemon for the desktop user is gone. Running 'ibus-daemon --xim -d' as user fixes the keyboard input problem.
Comment 7 Silver Salonen 2017-10-02 05:49:53 UTC
Wow, that totally fixes the problem for me!

Thank you very much Theo!
Comment 8 Patrick Rudolph 2017-10-02 05:58:41 UTC
I can confirm that running ibus-daemon --xim -d as user fixes the problem.
I had to place it inside a while loop to restart it automatically every time I switch ttys as the ibus daemon crashes.
Comment 9 Patrick Rudolph 2017-10-02 06:50:44 UTC
Turns out the ibus behaviour on tty change is already fixed here: https://bugs.kde.org/show_bug.cgi?id=379930
Comment 10 Silver Salonen 2017-10-02 07:01:37 UTC
Ok, I'll mark it as duplicate then.

*** This bug has been marked as a duplicate of bug 379930 ***
Comment 11 Silver Salonen 2017-10-03 20:29:39 UTC
Okay, I cheered to soon. For me ibus-daemon doesn't actually crash - it's running fine after I log into Plasma5. When I don't have it running then input just doesn't work in even more applications. But killing or restarting it doesn't make everything work still :(
Comment 12 Theo 2017-10-08 14:58:39 UTC
(In reply to Theo from comment #6)
> This happens often
> after my system has been stalled when running out of memory. Once my system
> is responding again, the IBus daemon for the desktop user is gone.
For the record, apparently IBus is indeed killed when switching to TTY. I wasn't aware of this when I wrote that comment.
Comment 13 Christoph Feck 2017-10-12 19:49:24 UTC
So let's recap: This issue is related to IBus. Does uninstalling it resolve the issue? I doubt Plasma has any influence on input.
Comment 14 Silver Salonen 2017-10-12 19:57:21 UTC
For me it doesn't indeed change a thing - I removed everything related to ibus and after logging out and in again the state is exactly the same. Ie. input in KWallet input request does not work, but to some other applications input works. This has somehow improved since some time (as I reported at some point, input in KRunner dialog or in launcher menu didn't work, but now it does), but I have no idea with what and when exactly.
Comment 15 Silver Salonen 2017-10-13 03:42:14 UTC
Sorry, I'm giving inconsistent information :/
I did full upgrade of all my software (did not re-install ibus) and restarted my computer, and now keyboard input works also for KWallet right after login.
Comment 16 Nate Graham 2017-10-16 04:35:15 UTC
Anything left to investigate here? Can we close the bug?
Comment 17 Silver Salonen 2017-10-16 07:22:45 UTC
To my mind it's somewhat clear that it is related to ibus, but is it really clear how?

As I understand on one case ibus crashes and this causes keyboard input issues, but on another case (mine) the issue is solved when this solves issues.
Comment 18 Theo 2017-10-16 22:56:37 UTC
(In reply to Nate Graham from comment #16)
> Anything left to investigate here? Can we close the bug?
IBus is no longer killed by switching to TTY after I updated to Plasma 5.11.0 on my openSUSE Tumbleweed.
Comment 19 Nate Graham 2017-10-17 02:31:46 UTC
Great, sounds like this may be fixed now! Is anyone else still able to reproduce with Plasma 5.11.0?
Comment 20 Silver Salonen 2017-10-17 04:47:45 UTC
One additional weird nuance - on startup both KWallet and Gnome Keyring are asking for input (the latter because of Skype). Even if KWallet is focused then keyboard input does not work until I haven't inserted password for Keyring. Also it seems that keyboard input does not work within the whole environment, eg. Alt+Tab, Alt+F2, Launcher menu search. After I submit anything into Keyring dialog, keyboard input starts working for both Plasma and KWallet dialog.
Comment 21 Theo 2017-10-19 10:46:36 UTC
(In reply to Silver Salonen from comment #20)
> keyboard input does not work until I haven't inserted password for
> Keyring.
Same for me when I start Skype any time during a KDE session. The Gnome Keyring prompt seem to block all keyboard input for anything but itself. If I remember correctly, this also happened with the graphical password prompt for the SSH agent (x11-ssh-askpass by Jim Knoble) that used to ask for my passphrase at the start of the session.
Comment 22 Christoph Feck 2017-11-24 00:50:04 UTC
*** Bug 384891 has been marked as a duplicate of this bug. ***
Comment 23 Silver Salonen 2017-11-24 05:09:44 UTC
I don't know now... to me it has really boiled down to Keyring blocking the input. Is there something that can be done about it from KDE/Plasma side?
Comment 24 Christoph Feck 2017-12-20 19:20:46 UTC
Please report it to the bug tracker of the application or service that blocks the keyboard input. We cannot magically get input when something else prevents that.