Bug 439469

Summary: Maliit virtual keyboard does not work on neon unstable due to QT_IM_MODULE being set to ibus by some unnecessary package being pre-installed
Product: [KDE Neon] neon Reporter: Patrick Silva <bugseforuns>
Component: Packages Unstable EditionAssignee: Neon Bugs <neon-bugs>
Status: REOPENED ---    
Severity: normal CC: aleixpol, authenticastrology, jr, nate, neon-bugs, sitter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Patrick Silva 2021-07-04 11:34:19 UTC
SUMMARY
I have configured Maliit virtual keyboard on neon unstable following these instructions:

https://blog.martin-graesslin.com/blog/2021/03/using-maliit-keyboard-in-a-plasma-wayland-session/

Maliit is enabled but it never shows up when a text field/box is focused.


SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.22.80
KDE Frameworks Version: 5.84.0
Qt Version: 5.15.3
Graphics Platform: Wayland
Comment 1 Nate Graham 2021-07-30 16:11:41 UTC
1. Is it selected as the input method in System Settings?
2. Is it enabled in its System Tray applet?
Comment 2 Patrick Silva 2021-07-30 17:07:45 UTC
(In reply to Nate Graham from comment #1)
> 1. Is it selected as the input method in System Settings?
> 2. Is it enabled in its System Tray applet?

1. yes
2. yes
Comment 3 Nate Graham 2021-08-02 17:04:54 UTC
What is the QT_IM_MODULE environment variable set to? You can check with `echo $QT_IM_MODULE`.
Comment 4 Patrick Silva 2021-08-03 11:22:10 UTC
(In reply to Nate Graham from comment #3)
> What is the QT_IM_MODULE environment variable set to? You can check with
> `echo $QT_IM_MODULE`.

ibus
Comment 5 Nate Graham 2021-08-03 13:10:07 UTC
That's almost certainly the problem. Can you unset it (`unset QT_IM_MODULE`) and then in the same terminal window, restart plasmashell? If that doesn't work, probably KWin needs to be restarted with it unset too.

Either way, this would seem to be a Neon bug for installing packages by default that set this environment variable. Most likely some runtime userspace IBus thing for the Emoji picker which is not needed (only libraries are needed, not the user-facing IBus software).
Comment 6 Aleix Pol 2021-08-03 15:54:07 UTC
Yes, confirmed.
Comment 7 Patrick Silva 2021-08-04 11:34:36 UTC
(In reply to Nate Graham from comment #5)
> Can you unset it (`unset QT_IM_MODULE`)
> and then in the same terminal window, restart plasmashell?

virtual keyboard works after your instructions.
Comment 8 Harald Sitter 2021-08-04 12:48:32 UTC
Wouldn't one need that set to... you know... do ibus stuff? Like for CJK input and stuff.
Comment 9 Harald Sitter 2021-08-04 12:53:51 UTC
Also, I don't see QT_IM_MODULE set on a neon unstable out of the box.
Comment 10 Aleix Pol 2021-08-04 14:03:13 UTC
/etc/profile.d/org.kde.neon.ibus.sh sets it.

The plan here is to have, on Wayland, ibus communicate with the compositor through the text input protocols, so it should be kwin starting ibus, not having every app set in ibus mode.
Comment 11 Harald Sitter 2021-08-04 14:17:30 UTC
org.kde.neon.ibus.sh is for korean only though.

Anyway, so, org.kde.neon.ibus.sh should only set the env var when not in a wayland session?
Also, does this ibus-compositor dance already work?
Comment 12 Aleix Pol 2021-08-04 15:59:46 UTC
It might be korean, it somehow ended up in my system.

It does work, I'm sure it could use more love.

For now, yes, changing it to only enable only on X11 would make sense. I'm not sure if there's a great reliable way to check though as profile.d is run before the session starts. WAYLAND_DISPLAY won't be set, I guess DISPLAY (for X11) will.
Comment 13 Bug Janitor Service 2021-08-05 10:02:02 UTC
A possibly relevant merge request was started @ https://invent.kde.org/neon/neon/settings/-/merge_requests/8
Comment 14 Harald Sitter 2021-08-17 14:06:37 UTC
Git commit 7222a67b1b9590d2cdde89786ccdb27de83a1322 by Harald Sitter.
Committed on 17/08/2021 at 14:06.
Pushed by sitter into branch 'Neon/release'.

only set ibus as input method on x11

on wayland IMs are handled through a wayland protocol and setting the
explicit IM gets in the way of things.

M  +12   -2    ko/etc/profile.d/org.kde.neon.ibus.sh

https://invent.kde.org/neon/neon/settings/commit/7222a67b1b9590d2cdde89786ccdb27de83a1322
Comment 15 Patrick Silva 2021-08-22 12:10:07 UTC
It's still not working. Mallit is enabled in Virtual Keyboard KCM but
the option to activate it is missing from system tray.
Comment 16 Nate Graham 2021-08-23 14:14:02 UTC
That's a separate issue that was caused by the old SNI being removed and replaced with an applet. The applet is not currently showing up in the System Tray as it should. This is a known issue and something we'll get fixed before Plasma 5.23 ships.
Comment 17 Patrick Silva 2021-09-22 11:20:22 UTC
it's still not working. The icon in system tray indicates that maliit
is activated but it does not show up when a text field is focused.

Output of '$echo $QT_IM_MODULE' is still 'ibus'.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.23.80
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.3
Graphics Platform: Wayland
Comment 18 Aleix Pol 2021-09-22 15:53:16 UTC
can you check your /etc/profile.d/org.kde.neon.ibus.sh file? maybe these don't update because it's inside /etc?
Comment 19 Patrick Silva 2021-09-23 10:39:29 UTC
contents of mentioned file:

export QT_IM_MODULE=ibus
export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus

I have deleted this file, reinstalled maliit-keyboard and maliit-framework
packages and restarted Plasma session. Maliit is finally working.
Comment 20 Nate Graham 2021-09-23 13:56:18 UTC
Yeah IIRC it is an Ubuntu-specific bug that files in /etc don't get automatically deleted when removed by the packaging.
Comment 21 Aleix Pol 2021-09-24 17:17:44 UTC
Can someone test that it works? I asked sitter and he says it does get updated.
Comment 22 authenticastrology 2024-01-01 14:24:01 UTC
(In reply to Nate Graham from comment #5)
> That's almost certainly the problem. Can you unset it (`unset QT_IM_MODULE`)
> and then in the same terminal window, restart plasmashell? If that doesn't
> work, probably KWin needs to be restarted with it unset too.
> 
> Either way, this would seem to be a Neon bug for installing packages by
> default that set this environment variable. Most likely some runtime
> userspace IBus thing for the Emoji picker which is not needed (only
> libraries are needed, not the user-facing IBus software).

How do you, as a noob, restart plasmashell and kwin from the command line with the 6 Beta 2 unstable edition?
Comment 23 Nate Graham 2024-01-10 19:30:07 UTC
Easiest way is to just restart the system.
Comment 24 authenticastrology 2024-01-10 19:41:32 UTC
Yes, it just makes me disable ibus again