Bug 428213

Summary: When IBus is launched after Qt apps, it can't enter text in those apps
Product: [Frameworks and Libraries] libplasma Reporter: stpaulgym <stpaulgym>
Component: componentsAssignee: Marco Martin <notmart>
Status: RESOLVED UPSTREAM    
Severity: normal CC: david.cortes.rivera, kishore96, nate, plasma-bugs, wengxt
Priority: HI    
Version: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
URL: https://bugreports.qt.io/browse/QTBUG-75681
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description stpaulgym@protonmail.com 2020-10-25 05:09:15 UTC
SUMMARY
Asian input via ibus does not work. Types in English despite having Korean selected

STEPS TO REPRODUCE
1. Install Ibus and ibus-hangul
2. Enable Ibus hangul from ibus preferences
3. Added export
 GTK_IM_MODULE=ibus
 export XMODIFIERS=@im=ibus
 export QT_IM_MODULE=ibus
to .xprofile as stated in the Arch wiki(the issue happens regardless)
4. Select Korean input
5. Open start menu
6. Type 


OBSERVED RESULT
English is typed

EXPECTED RESULT
Korean is typed

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: EndeavourOS KDE
(available in About System)
KDE Plasma Version: happens regardless of version
KDE Frameworks Version: happens regardless of version
Qt Version: happens regardless of version
ADDITIONAL INFORMATION
Korean input works on other QT apps like Krita and dolphin. It's the just the start menu and other Plasma UI apps that have this behaviour
Comment 1 Kishore Gopalakrishnan 2021-08-08 08:55:54 UTC
I believe this happens if ibus-daemon is started after plasmashell. On my machine, ibus input works in plasmashell if I restart plasmashell (something like `kquitapp5 plasmashell; kstart5 plasmashell; sleep 5; kstart5 /usr/lib/kimpanel-ibus-panel`) after logging in.

I'm guessing that the only way to reliably ensure that ibus-daemon starts before plasmashell is to use systemd startup for Plasma, and then add something like `WantedBy=whatever.name.plasmashell.uses.service` to the service file which you use to start ibus-daemon.

Note that putting 'X-KDE-autostart-phase=0' into the startup .desktop file for ibus-daemon does not seem to reliably start it before plasmashell.
Comment 2 Nate Graham 2022-01-21 05:35:58 UTC
Are you able to reproduce this issue in Plasma 5.23 or the 5.34 beta?
Comment 3 Kishore Gopalakrishnan 2022-01-23 10:07:31 UTC
(In reply to Nate Graham from comment #2)
> Are you able to reproduce this issue in Plasma 5.23 or the 5.34 beta?

For me, it is reproducible on one user account, but not in a fresh one. Even on the user account where it is reproducible, restarting plasmashell ( kquitapp5 plasmashell; kstart5 plasmashell ) after logging in fixes the issue.

SOFTWARE VERSIONS:
Operating System: Arch Linux
KDE Plasma Version: 5.23.90
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.16.2-arch1-1 (64-bit)
Graphics Platform: X11
Comment 4 Nate Graham 2022-01-24 17:18:29 UTC
Does the search field in Discover do the same thing?
Comment 5 Kishore Gopalakrishnan 2022-01-29 12:46:01 UTC
(In reply to Nate Graham from comment #4)
> Does the search field in Discover do the same thing?

The search field in Discover works correctly.
Comment 6 Nate Graham 2022-01-31 17:33:34 UTC
Thanks!

I wonder what we're doing wrong in our Plasma Components to make this happen. Any ideas, Xuetian?
Comment 7 Weng Xuetian 2022-02-01 23:13:19 UTC
I suggest report this to Qt to fix their IBus implementation. Their implementation of ibus platform input context should be able to handle this just like what I did in fcitx.

If they implement it correctly, there should be no tricks required on the plasma side.
Comment 8 Weng Xuetian 2022-02-01 23:18:17 UTC
The issue can be easily reproduced by
1. quit ibus
2. start kwrite
3. start ibus
4. try to type in kwrite.

Which demonstrate that it is not relevant to plasma.

IBus's own implemenation of Gtk im module works well if ibus restarts. It's solely Qt's ibus plugin problem that can't handle such case well.
Comment 9 Nate Graham 2022-02-02 19:09:27 UTC
Thanks! Looks like there's an upstream bug report about it: https://bugreports.qt.io/browse/QTBUG-75681
Comment 10 Nate Graham 2022-02-11 19:01:13 UTC
*** Bug 417994 has been marked as a duplicate of this bug. ***
Comment 11 Nate Graham 2022-02-11 19:01:20 UTC
*** Bug 431232 has been marked as a duplicate of this bug. ***
Comment 12 David 2022-02-11 23:42:16 UTC
Not sure if Bug 417994 is a duplicate, since that bug doesn't affect kwrite behavior.
Comment 13 Nate Graham 2022-02-11 23:47:43 UTC
Hmm, maybe it is a similar but not identical Qt issue.

Can you search through the bugs at https://bugreports.qt.io/secure/QuickSearch.jspa?searchString=ibus and see if any ones there describe your issue?