IBus lookup table appears bottom left of application (x11)

Bug #1969637 reported by Ikuya Awashiro
28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
GNOME Settings Daemon
Fix Released
Unknown
ibus
Fix Released
Unknown
openSUSE
Fix Released
Medium
gnome-settings-daemon (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
High
Gunnar Hjalmarsson
im-config (Debian)
Fix Released
Unknown
im-config (Ubuntu)
Fix Released
High
Unassigned

Bug Description

[Impact]

Changes in gnome-settings-daemon v. 42 resulted in IM issues in GNOME on Xorg. On Ubuntu the effect is that the candidate window is misplaced, and appears at the bottom of the application window instead of close to the cursor. It's an annoying enough issue to justify an SRU.

[Test Plan]

On an updated Ubuntu 22.04:

1. Install ibus-libpinyin

2. Run these commands:

   sudo locale-gen zh_CN.UTF-8
   sudo update-locale LC_CTYPE=zh_CN.UTF-8

3. Reboot and log in to an Ubuntu on Xorg session

4. Add "Intelligent Pinyin" to the input sources

5. Open gedit, switch to "Intelligent Pinyin", and input something.

=> Find that the candidate window is misplaced.

6. Install gnome-settings-daemon{,-common} from jammy-proposed and
   reboot

7. Repeat step 5.

=> Find that the candidate window is shown close to the cursor as
   expected.

[Where problems could occur]

The change is an upstream MR and a one-liner. It shouldn't reasonably affect anything but ibus configuration, and I have successfully tested it back and forth in both x11 and wayland sessions.

[Other Info]

This change has not yet reached kinetic, but will do so later when g-s-d is upgraded. The issue has temporarily been addressed in Debian (and soon in kinetic via sync) through an im-config workaround, which will be dropped later when g-s-d is updated. But for an SRU I think it's better to make the more proper g-s-d change directly.

[Original description]

I know it is not im-config issue. I don't know what is root cause.

how to reproduce:
1. Install Ubuntu 22.04 LTS or apply newest update
2. boot
3. select a user
4. select Ubuntu on Xorg
5. input password
6. login
7. run gedit
8. push Hankaku/Zenkaku key
9. input any keys
10. lookup table appears bottom left of application

proposed fix:
edit DESKTOP_SETUP_IBUS="GNOME" to DESKTOP_SETUP_IBUS="" on /etc/default/im-config

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: im-config 0.50-2
ProcVersionSignature: Ubuntu 5.15.0-25.25-generic 5.15.30
Uname: Linux 5.15.0-25-generic x86_64
ApportVersion: 2.20.11-0ubuntu82
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Thu Apr 21 00:13:10 2022
InstallationDate: Installed on 2022-04-20 (0 days ago)
InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Daily amd64 (20220415)
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=ja_JP.UTF-8
 SHELL=/bin/bash
SourcePackage: im-config
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
In , Hillwood Yang (hillwoodroc) wrote :

Created attachment 857578
on gnome ternimal

Triggering conditions: Update Tumbleweed to version 20220323+ or fresh install with gnome.
Cursor can not follow on Firefox and Gnome terminal.

Revision history for this message
In , Hillwood Yang (hillwoodroc) wrote :

Created attachment 857579
on firefox

Revision history for this message
In , Ftake (ftake) wrote :

Does this problem still reproduce with GNOME 42?
Which session type do you use? GNOME Wayland or GNOME X11?

It looks like IBus is working with xim protocol.

Revision history for this message
In , Hillwood Yang (hillwoodroc) wrote :

(In reply to Fuminobu Takeyama from comment #2)
> Does this problem still reproduce with GNOME 42?
> Which session type do you use? GNOME Wayland or GNOME X11?
>
> It looks like IBus is working with xim protocol.

Yep, and it only reproduces on GNOME 42. It works fine on Gnome 41.

GNOME 42 Wayland is invaild on my system. I do not test on Wayland.

Revision history for this message
In , Ftake (ftake) wrote :

GTK_IM_MODULE is not specified now. So maybe GTK X11 applications uses xim, which does not support showing candidate window under the cursor.

Note that GTK_IM_MODULE should not be set under GNOME wayland session because it now use Wayland input method protocol instead of GTK IM Module. We have to find out why GTK_IM_MODULE is not set even for X11 sessions.

Revision history for this message
In , Ftake (ftake) wrote :
Revision history for this message
Ikuya Awashiro (ikuya-fruitsbasket) wrote :
Changed in ibus:
status: Unknown → Fix Released
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Thanks for your report.

Hmm.. First I thought of bug #1966552, but that one was only about some specific non-standard applications. It was not about e.g. gedit.

And I can't reproduce it. For me, the candidate window shows up close to the cursor as expected. (Tried with ibus-mozc; assuming that's what you used too.)

Not sure what else to say at this stage..

Well, your proposed fix is not possible to implement. It would result in GTK_IM_MODULE=ibus being set for all GNOME users in both wayland and xorg sessions, and as regards wayland sessions it would result in adverse side effects. For instance it would break the Screen Keyboard feature.

Revision history for this message
Ikuya Awashiro (ikuya-fruitsbasket) wrote (last edit ):

Is it a locale issue?
When my environment changed to C.UTF-8 locale, worked great for me.

> Well, your proposed fix is not possible to implement.
OK, I will propose another fix.

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

Yes, it's a locale issue somehow. Good catch!

When I first tested I didn't even have the Japanese locale generated. But after doing:

sudo locale-gen ja_JP.UTF-8
sudo update-locale LC_CTYPE=ja_JP.UTF-8

I can reproduce the issue in a Xorg session.

But it's not specific to ja_JP.UTF-8 (it hasn't been changed since 2019). I see the issue also if I set LC_CTYPE=zh_CN.UTF-8. And it does not only affect ibus-mozc. The candidate window is misplaced also when I use ibus-libpinyin in a Xorg session.

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

I tested on Debian testing too, and there it's even worse in Xorg sessions: When using gedit, I couldn't input using IBus IMs at all. Also there it helps to set GTK_IM_MODULSE=ibus.

So I drafted a merge request with a possible im-config fix (or workaround):

https://salsa.debian.org/input-method-team/im-config/-/merge_requests/15

But before doing anything I want to talk with some Debian folks. I'll submit a Debian bug report later.

Revision history for this message
Ikuya Awashiro (ikuya-fruitsbasket) wrote (last edit ):

Hi Gunnar, thank you for your testing!

It is my current analysis:
It must be caused by below two commits.

https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/commit/e2d268eb00f06f497b2f62ae9f3b6e7e1fe4bd9e
https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/commit/c8981ef0b1e915e89c79e301080541baef0f9fa9

$ gsettings get org.gnome.desktop.interface gtk-im-module
''
$ gsettings set org.gnome.desktop.interface gtk-im-module 'ibus'

This command works as expected immediately.
But according to commit messages, it is not intended for GNOME 42.

And I don't know why Fedora 36 works so great.

Revision history for this message
In , Ftake (ftake) wrote :

Ubuntu launchpad (a workaround available):
https://bugs.launchpad.net/ubuntu/+source/im-config/+bug/1969637

Changed in opensuse:
importance: Unknown → Medium
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote : Re: lookup table appears bottom left of application

On 2022-04-21 12:44, Ikuya Awashiro wrote:
> It must be caused by bottom two commits.
>
> https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/commit/e2d268eb00f06f497b2f62ae9f3b6e7e1fe4bd9e
> https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/commit/c8981ef0b1e915e89c79e301080541baef0f9fa9
>
> $ gsettings get org.gnome.desktop.interface gtk-im-module
> ''
> $ gsettings set org.gnome.desktop.interface gtk-im-module 'ibus'
>
> This command works as expected immediately.

Hmm.. Previously that value was controlled dynamically. It defaulted to "gtk-im-context-simple", but as soon as some ibus IM was present in the list of input sources (or the OSK was enabled) the value switched automatically to "ibus".

That's why it worked fine without setting GTK_IM_MODULE=ibus explicitly, and we could prevent im-config from doing anything in case of a GNOME desktop.

> But according to commit messages, it is not intended for GNOME 42.

Do you understand what their intention actually is?

> And I don't know why Fedora 36 works so great.

Is GTK_IM_MODULE unset there? I have noticed that the upstream ibus maintainer (who is a Fedora guy) frequently advises users to set GTK_IM_MODULE=ibus. He seems to consider that to be a normal measure on x11 and not a workaround.

summary: - lookup table appears bottom left of application
+ lookup table appears bottom left of application (x11)
tags: added: regression-release x11
summary: - lookup table appears bottom left of application (x11)
+ IBus lookup table appears bottom left of application (x11)
Changed in im-config (Debian):
status: Unknown → New
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

I submitted an upstream gnome-settings-daemon issue. Unless I get any useful response to that within a couple of days, I'll proceed with the im-config workaround.

Revision history for this message
Ikuya Awashiro (ikuya-fruitsbasket) wrote :

Sorry for late reply.

> Do you understand what their intention actually is?
It is too difficult question for me. I don't understand "the gtk-im-module setting can be considered in full control of the user." is mean.
We may consider to revert c8981ef0b1e915e89c79e301080541baef0f9fa9 just like keyboard-Use-ibus-sources-from-locale.patch for gnome-settings-daemon.

> Is GTK_IM_MODULE unset there?
GTK_IM_MODULE is set by anyone (imchooser?).

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

On 2022-04-24 17:13, Ikuya Awashiro wrote:
> We may consider to revert c8981ef0b1e915e89c79e301080541baef0f9fa9
> just like keyboard-Use-ibus-sources-from-locale.patch for
> gnome-settings-daemon.

Nah.. That kind of reversals add to the maintenance burden and should be avoided. The patch you mention is to keep a feature which was explicitly dropped by GNOME but which we wanted to keep.

> GTK_IM_MODULE is set by anyone (imchooser?).

So that may be the reason why you found that Fedora 36 works fine on x11.

Maybe the intention is that GTK_IM_MODULE should be set. But if it is, why doesn't GNOME do that here:

https://gitlab.gnome.org/GNOME/gnome-session/-/blob/main/gnome-session/main.c#L592

description: updated
no longer affects: gnome-settings-daemon (Ubuntu Jammy)
Changed in im-config (Ubuntu):
importance: Undecided → High
status: New → Fix Committed
Changed in im-config (Ubuntu Jammy):
assignee: nobody → Gunnar Hjalmarsson (gunnarhj)
importance: Undecided → High
status: New → In Progress
Changed in im-config (Debian):
status: New → Fix Released
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Noticed the Ask Ubuntu question <https://askubuntu.com/q/1405101>. So it's good that a fix is on its way.

description: updated
no longer affects: im-config (Ubuntu Jammy)
Changed in gnome-settings-daemon (Ubuntu):
status: New → Fix Committed
status: Fix Committed → In Progress
Changed in gnome-settings-daemon (Ubuntu Jammy):
assignee: nobody → Gunnar Hjalmarsson (gunnarhj)
importance: Undecided → High
status: New → In Progress
no longer affects: im-config (Ubuntu Jammy)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package im-config - 0.51-1

---------------
im-config (0.51-1) unstable; urgency=medium

  * Team upload
  * Set GTK_IM_MODULE in GNOME on Xorg sessions
    - Closes: #1009996, LP: #1969637

 -- Gunnar Hjalmarsson <email address hidden> Wed, 27 Apr 2022 12:09:43 +0200

Changed in im-config (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Ikuya, or anyone else affected,

Accepted gnome-settings-daemon into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gnome-settings-daemon/42.1-1ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in gnome-settings-daemon (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

I successfully accomplished the steps in the test plan using version 42.1-1ubuntu2.1 of gnome-settings-daemon{,-common} from jammy-proposed.

tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Ikuya Awashiro (ikuya-fruitsbasket) wrote :

Hi Gunnar,

Thank you for your great work.
This fix is really good for everyone.

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

Thank *you* Ikuya! :) It was you who figured out that the root cause lies in g-s-d.

Revision history for this message
In , Ftake (ftake) wrote :
Revision history for this message
In , Alynx-zhou-u (alynx-zhou-u) wrote :

*** Bug 1198710 has been marked as a duplicate of this bug. ***

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for gnome-settings-daemon has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-settings-daemon - 42.1-1ubuntu2.1

---------------
gnome-settings-daemon (42.1-1ubuntu2.1) jammy; urgency=medium

  * d/p/u/xsettings_Remove_direct_mapping_from_gtk-im-module_to_G.patch:
    - Upstream MR which fixes IBus config. issue on x11 (LP: #1969637)

 -- Gunnar Hjalmarsson <email address hidden> Sat, 30 Apr 2022 00:26:51 +0200

Changed in gnome-settings-daemon (Ubuntu Jammy):
status: Fix Committed → Fix Released
Changed in gnome-settings-daemon:
status: Unknown → New
Changed in gnome-settings-daemon:
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-settings-daemon - 42.2-1ubuntu1

---------------
gnome-settings-daemon (42.2-1ubuntu1) kinetic; urgency=medium

  * Merge with Debian. Remaining changes:
    + debian/control.in:
      - Build-depend on accountsservice
      - Drop build-dependency on libnss-dev and add to libgck-1-dev
      - Recommend pipewire-pulse instead of pulseaudio
    + debian/patches/ubuntu:
      - keyboard-sync-input-sources-to-accountsservice.patch
      - keyboard-Use-ibus-sources-from-locale.patch
      - lid-close-suspend-support.patch
      - media-keys-correct-logout-action.patch
      - media-keys-restore-terminal-keyboard-shortcut-schema.patch
      - print-notifications-suppress-printer-may-not-be-connected.patch
      - teach-gsd-about-the-gnome-calculator-snap-.desktop-name.patch
      - Revert-media-keys-fix-gnome-settings-desktop-file.patch
    + debian/patches/p11-kit:
      - Use p11-kit (via gck) as smartcards backend
    + debian/gnome-settings-daemon.install:
      - Install apport hook

gnome-settings-daemon (42.2-1) unstable; urgency=medium

  * Team upload
  * New upstream release (LP: #1969637)
  * Bump Standards-Version to 4.6.1

gnome-settings-daemon (42.1-3) unstable; urgency=medium

  * Drop Revert-sharing-Don-t-manage-gnome-remote-desktop.patch
    - gnome-remote-desktop 42 provides its own systemd user session
      to start itself

gnome-settings-daemon (42.1-2) unstable; urgency=medium

  * Team upload

  [ Jeremy Bicha ]
  * Seitch back to libgweather4
  * debian/control.in: Build-Depend on libgweather4
  * debian/control.in: Break older gnome-control-center (Closes: #1008493)

 -- Gunnar Hjalmarsson <email address hidden> Wed, 01 Jun 2022 15:29:11 +0200

Changed in gnome-settings-daemon (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
In , Alynx-zhou-u (alynx-zhou-u) wrote :

It seems upstream fixed this by https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/commit/16f19ba8155bf5fb4618d6e42548a350367f93c4.

We should have this in the latest update, is this fixed?

Revision history for this message
In , Ftake (ftake) wrote :

Thank you for letting me know.

I confirmed this problem has been resolved in gnome-settins-daemon 42.2

gnome-setting-daemon writes Gtk/IMModule "ibus". It seems that GTK reads this config and loads ibus-gtk3/4 under X11 session.

Please note that GTK_IM_MODULE is not set anymore.

Changed in opensuse:
status: Unknown → Fix Released
Revision history for this message
Romain Couturat (romaincout) wrote :

It seems there is still an edge case issue.
ctrl+; wouldn't work (eg: in gedit) on my freshly rebooted host, with up to date softwares proprietary nvidia drivers, Xorg and gnome on a 22.04 release-upgraded from a 21.10 initial installation)

ctrl+; was working with `GTK_IM_MODULE=ibus gedit` (with an underlined 'e' where I could type an emoji name to select it, a different interface than what follows)

I then installed (for the first time) both xsettingsd and unity-settings-daemon-schemas and ctrl+; was working in gedit (showing black or at least theme colored background box with emoji pictures) but not in gnome-terminal (even with `GTK_IM_MODULE=ibus gnome-terminal`)
The following env var hadn't changed:
XMODIFIERS=@im=ibus
GTK_MODULES=gail:atk-bridge
QT_IM_MODULE=ibus
(GTK_IM_MODULE was still unset)

I then uninstalled xsettingsd and unity-settings-daemon-schemas (also tried with --purge) and ctrl+; still works with gedit and still doesn't with gnome-terminal, even with a fresh reboot.

note : I have a "French Alt." keyboard layout

Revision history for this message
Romain Couturat (romaincout) wrote :

running
`echo GTK_IM_MODULE=ibus | sudo tee /etc/environment.d/99inputemoji.conf`
I have it working on both gedit and gnome-terminal (with the underlined 'e' interface) after a reboot

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

@Romain: This bug is closed. Please submit a new bug about that issue:

ubuntu-bug ibus

(I appreciate if you do, because I think that problem area is worth a separate discussion.)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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