IBus input method candidate box cannot follow the cursor

Bug #1966552 reported by Zhang
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ibus
Fix Released
Unknown
ibus (Ubuntu)
Invalid
Undecided
Unassigned
ibus-libpinyin (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I have tested it in some software, such as Microsoft Edge, Onlyoffice, and it does not follow the cursor position correctly, but always at the bottom left of the application window. However, in some applications such as Gedit, it works fine.

Pictures are here:https://i.bmp.ovh/imgs/2022/03/34ebb5158ceeedfc.png

OS: Ubuntu Jammy Jellyfish
Kernel: 5.15.0-23-generic
on Wayland

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: ibus-libpinyin 1.12.1-2ubuntu2
ProcVersionSignature: Ubuntu 5.15.0-23.23-generic 5.15.27
Uname: Linux 5.15.0-23-generic x86_64
ApportVersion: 2.20.11-0ubuntu79
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Sat Mar 26 23:59:28 2022
InstallationDate: Installed on 2022-02-09 (45 days ago)
InstallationMedia: Ubuntu 20.04.3 LTS "Focal Fossa" - Release amd64 (20210819)
SourcePackage: ibus-libpinyin
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Zhang (xiaozhangup) wrote :
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Thanks for your report!

I tested on some applications shipped with Ubuntu by default (LibreOffice Writer, Firefox, gedit, gnome-terminal) and couldn't reproduce the issue. On Wayland session (not Xorg) I did notice that if I open e.g. gedit or LibreOffice Writer, the candidate window may be shown at the wrong position after my very first key press. But already after the second key press it's shown close to the cursor as expected.

Maybe the issue is specific to certain applications, such as those you mentioned.

Anyway, I think this is an ibus issue rather than an ibus-libpinyin one. It would be good if you could confirm that by installing e.g. ibus-hangul and see if the issue is present also when inputting Korean.

Also, the issue is an upstream one. If you too conclude that it's probably an ibus issue, it would be great if you could submit an upstream issue:

https://github.com/ibus/ibus/issues/

If you do, please post the URL to it in a comment here for tracking purposes.

Revision history for this message
Zhang (xiaozhangup) wrote :

Indeed, all of the included applications were fine, so I pointed out other software, such as Microsoft Edge. i now go upstream to submit the problem

Revision history for this message
Zhang (xiaozhangup) wrote :
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

I doubt that. The page you linked to does not apply to Debian/Ubuntu systems. On GNOME desktops (including Ubuntu) we let GNOME set the required environment variables, and on other desktops they are set via the im-config package.

Also, I don't understand how the page is related to the problem with the position of the candidate window.

Revision history for this message
Zhang (xiaozhangup) wrote :

This is indeed a problem caused by the environment, but I found that my /etc/environment file was blank.
I did various tests and could finally determine that this would fix the problem directly.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

In any case using /etc/environment on Ubuntu for this purpose won't happen. But maybe your finding can be helpful in figuring out a proper fix.

Can you please clean up your /etc/environment from IM related variables, reboot, and run this command:

env | grep -E 'XMOD|_IM'

Probably it outputs:

XMODIFIERS=@im=ibus
QT_IM_MODULE=ibus

Then, as a test, please add only this line to /etc/environment:

GTK_IM_MODULE=ibus

and reboot. Is that sufficient to make the candidate window be shown correctly on e.g. Microsoft Edge?

Revision history for this message
Zhang (xiaozhangup) wrote :

Everything is just as you said it would be.And it correctly on Microsoft Edge.

Revision history for this message
Zhang (xiaozhangup) wrote :

Not just Edge, but all applications

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Ok, so setting "GTK_IM_MODULE=ibus" would work around the issue. That's valuable knowledge, and thank you for figuring it out.

Unfortunately you are not supposed to set that variable explicitly on a GNOME desktop, and especially not in a Wayland session. Doing so has adverse side effects, so we can't do it for all users just like that.

The root cause might be in some GNOME package, e.g. mutter. Not sure how to proceed. Maybe report it to ibus upstream to ask for help with the analysis.

Revision history for this message
Zhang (xiaozhangup) wrote (last edit ):

Both Xorg and Wayland can be solved this way, and this is what I just tested out.
They both seem to have this problem, but both can be solved this way.

Thank you for your positive response and help!

Changed in ibus:
status: Unknown → New
Changed in ibus:
status: New → Fix Released
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Marking this as invalid for ibus and ibus-libpinyin. ibus upstream provided an explanation and confirmed that the workaround makes sense.

Changed in ibus (Ubuntu):
status: New → Invalid
Changed in ibus-libpinyin (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.