Bug 2024120 - Plasma Wayland does not launch ibus-daemon
Summary: Plasma Wayland does not launch ibus-daemon
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: plasma-workspace
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: KDE SIG
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-17 11:18 UTC by fujiwara
Modified: 2021-11-18 10:51 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-11-18 07:12:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description fujiwara 2021-11-17 11:18:46 UTC
Description of problem:
Plasma Xorg runs ibus-daemon with imsettings-daemon from XDG autostart and Xinit file.

/etc/xdg/autostart/imsettings-start.desktop
/etc/X11/xinit/xinitrc.d/50-xinput.sh

But Plasma Wayland does not run ibus-daemon.
I think Plasma Wayland will manage focus events globally and communicate with ibus-daemon using the D-Bus methods as the Wayland composer likes GNOME Wayland.

Until Plasma upstream implements the input protocol, I'd suggest to just invoke ibus-daemon in Fedora downstream with an internal patch.

I'm thinking the following patch in Fedora.

--- /usr/libexec/plasma-dbus-run-session-if-needed.orig
+++ /usr/libexec/plasma-dbus-run-session-if-needed	
@@ -2,6 +2,18 @@
 # Usage: plasma-dbus-run-session-if-needed PROGRAM [ARGUMENTS]
 # If the session bus is not available it is spawned and wrapper round our program
 # Otherwise we spawn our program directly
+if [ -x /usr/libexec/xinput-run-in-session ] ; then
+    nohup /usr/libexec/xinput-run-in-session &
+fi
+
+if [ -f /usr/lib64/qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so ] || \
+   [ -f /usr/lib/qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so ] || \
+   [ -f /usr/lib64/qt4/plugins/inputmethods/libqtim-ibus.so ] || \
+   [ -f /usr/lib/qt4/plugins/inputmethods/libqtim-ibus.so ] ;
+then
+    export QT_IM_MODULE=ibus
+fi
+
 drs=
 if [ -z "${DBUS_SESSION_BUS_ADDRESS}" ]
 then



% cat /usr/libexec/xinput-run-in-session
#!/bin/sh

if [ -x /etc/X11/xinit/xinitrc.d/50-xinput.sh ] ; then
    # Wait for running a desktop session with D-Bus
    sleep 180

    /etc/X11/xinit/xinitrc.d/50-xinput.sh
    if [ -x /usr/bin/ibus ] ; then
        ibus exit
    fi
    imsettings-switch -n -q -x
fi

Comment 1 fujiwara 2021-11-17 11:23:32 UTC
If you're fine, I can create a pull request for Fedora.

Comment 2 Rex Dieter 2021-11-17 20:22:58 UTC
My f35 plasma wayland session has ibus-related stuff running:

[rdieter@fedora ~]$ ps au x| grep ibus
rdieter     8903  0.0  0.2 524216  8584 ?        Sl   13:40   0:00 /usr/bin/ibus-daemon -r --xim
rdieter     8914  0.0  0.1 449060  6576 ?        Sl   13:40   0:00 /usr/libexec/ibus-dconf
rdieter     8915  0.0  2.4 976356 96012 ?        Sl   13:40   0:00 /usr/libexec/ibus-ui-gtk3
rdieter     8918  0.1  1.2 615316 47588 ?        Sl   13:40   0:03 /usr/libexec/ibus-extension-gtk3
rdieter     8920  0.0  1.5 644936 61184 ?        Sl   13:40   0:00 /usr/libexec/ibus-x11 --kill-daemon
rdieter     8926  0.0  0.1 449008  6056 ?        Ssl  13:40   0:00 /usr/libexec/ibus-portal
rdieter     9014  0.0  0.1 375224  6608 ?        Sl   13:40   0:00 /usr/libexec/ibus-engine-simple

Or is this not what you're talking about here?

Comment 3 Jens Petersen 2021-11-18 02:42:47 UTC
(In reply to Rex Dieter from comment #2)
> My f35 plasma wayland session has ibus-related stuff running:

I suggest trying in a Plasma Live image or for a refresh VM/user.
We found it rather tricky to get ibus up and running in current Fedora KDE.

Comment 4 fujiwara 2021-11-18 07:12:51 UTC
(In reply to Rex Dieter from comment #2)
> My f35 plasma wayland session has ibus-related stuff running:
> 

You're right. Seems I was confused by bug 2023222 .

I'm closing this issue at the moment and will file another bug for Plasma Wayland to export QT_IM_MODULE environment variable and the suggested fix is similar with this bug description.

Comment 5 Jens Petersen 2021-11-18 10:51:25 UTC
Okay based on input from Takao I did manage now to get ibus working in Xorg now, though reboots should really not be necessary.

1. install KDE Spin (I used latest Rawhide iso) - I installed for Japanese locale
2. switch to Xorg and login
3. install ibus-anthy or some other ibus IME
4. reboot
5. install im-chooser and imsettings-qt and turn on ibus
6. reboot and login
7. then the ibus applet is already running in the panel (rather hard to see because both dark)
8. start kwrite and activate ibus Anthy IME and input Japanese

A few of these steps can probably we combined (like installation) or the order does not always matter (eg "2. Xorg" can be later).

What can I do better?
Doesn't Plasma also have a custom ibus GUI widget indicator UI?

And for Wayland additionally it is necessary to manually export QT_IM_MODULE=qt say in Konsole to launch apps to get ibus working there.


Note You need to log in before you can comment on or make changes to this bug.