Bug 392130

Summary: Plasma + Wayland: KDE IM Panel + ibus show their candidate window at wrong position
Product: [Plasma] kwin Reporter: Fuminobu TAKEYAMA <ftake>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: REPORTED ---    
Severity: normal CC: abdunnafialif, ad.liu.jin, ftake, justin.zobel, nate, xaver.hugl
Priority: NOR Keywords: wayland-only
Version First Reported In: 5.12.4   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: screen shot of a KDE IM panel's candidate window

Description Fuminobu TAKEYAMA 2018-03-21 09:05:20 UTC
Created attachment 111537 [details]
screen shot of a KDE IM panel's candidate window

On plasma wayland session, Plasma KIM panel does show its candidate window at the cursor position.

It seems that KIM panel try to put the window at the relative position from the active window, but actually, the candidate window is placed at the absolute position from the screen top-left.

This problem should be related to the well-known limitation that each application cannot get its absolute position on a screen on Wayland.

To avoid this problem, GNOME Shell retrieve the correct position by asking Wayland compositor.
https://github.com/GNOME/gnome-shell/blob/master/js/ui/ibusCandidatePopup.js#L185

Bug report in openSUSE:
https://bugzilla.opensuse.org/show_bug.cgi?id=1085778
Comment 1 Nate Graham 2021-03-04 20:04:36 UTC
Is this still happening to you in Plasma 5.21?
Comment 2 Fuminobu TAKEYAMA 2021-03-09 14:31:08 UTC
Yes. I confirmed today with Plasma 5.21 from KDE Neon.
Comment 3 Bug Janitor Service 2021-03-24 04:33:38 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Fuminobu TAKEYAMA 2021-03-25 13:39:59 UTC
just forgot to change status
Comment 5 Alif 2023-08-10 01:11:03 UTC
(In reply to Nate Graham from comment #1)
> Is this still happening to you in Plasma 5.21?

It is happening to me too.

SUMMARY
When logged in with wayland, ibus candidate selection window does not follow the insertion pointer for some apps and does follow for some others. For example; the selection window does follow the insertion pointer for Discord, Google Chrome, OnlyOffice etc; but does not follow for LibreOffice, Firefox, Telegram etc. It works as expected in Gnome for both X11 and Wayland but on Plasma it works only on X11.

STEPS TO REPRODUCE
1. Log in with wayland
2. Type with an ibus input method which uses candidate selection window; such as: typing booster.
3. Notice that the candidate selection window is either at the top left or at its last used position.

OBSERVED RESULT
The candidate selection window does not follow the insertion pointer (the position the user is typing at) for all apps.

EXPECTED RESULT
The candidate selection window should follow the insertion pointer for all apps.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 38
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10
Kernel Version: 6.4.8-200.fc38.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: Acer
Product Name: TravelMate P214-53
System Version: V1.43
Comment 6 Alif 2023-08-10 03:47:48 UTC
The candidate window does follow the insertion pointer for some apps. (Check my previous comment in this bug_report.) And does not follow the insertion pointer for some other apps. The issue is still not resolved completely.
Comment 7 Zamundaaa 2023-12-12 11:27:19 UTC
ibus recently gained proper Wayland support, which gets used in Fedora 39. Is the problem still happening with that?
Comment 8 Bug Janitor Service 2023-12-27 03:46:16 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 9 Bug Janitor Service 2024-01-11 03:45:36 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 10 Zamundaaa 2024-01-11 16:11:14 UTC
Why did you set this back to reported? The question has not been answered
Comment 11 Fuminobu TAKEYAMA 2024-01-17 13:54:41 UTC
ibus-ui-gtk3, IM panel provided by IBus upstream now works with Wayland. Its candidate window is placed under the cursor.

However KDE's input method panel (aka. KIM Panel) still does not work under Wayland session.
Comment 12 Jin Liu 2024-01-18 03:47:48 UTC
Tested another IME `fcitx5`. Kimpanel works with it under Wayland.

Trying to test `ibus`, but in Arch, the desktop file explicitly disabled panel with in the cmdline:
`/usr/lib/ibus/ibus-ui-gtk3 --enable-wayland-im --exec-daemon --daemon-args "--xim --panel disable"`

I modified `--panel disable` to `--panel /usr/lib/kimpanel-ibus-panel`. Kimpanel shows, but `ibus` still uses its own candidate window.

So unable to reproduce.

Could you share your `pgrep -a ibus` result, so I can start `ibus` the proper way?

My `ibus` version: 1.5.29

Operating System: Arch Linux 
KDE Plasma Version: 5.92.0
KDE Frameworks Version: 5.248.0
Qt Version: 6.6.1
Kernel Version: 6.7.0-arch3-1 (64-bit)
Graphics Platform: offscreen
Processors: 12 × AMD Ryzen 5 5600H with Radeon Graphics
Memory: 13.5 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Comment 13 Fuminobu TAKEYAMA 2024-01-24 13:52:38 UTC
Kimpanel does not start automatically on environment now.
So I tried:

ibus-daemon --panel=/usr/libexec/kimpanel-ibus-panel
QT_IM_MODULE=ibus kate

By specifying QT_IM_MODULE, ibus does not talk with applications using Wayland's text-input protocol. So I think this is wrong way.