Comment 0 for bug 823202

Revision history for this message
Fumihito YOSHIDA (hito) wrote : [Oneiric] ibus does not register as default IM, GTK_IM_MODULE is always "xim"

In oneiric(GTK3) environments, environment variable "GTK_IM_MODULE" always set as "xim", not "ibus".

[How to reproduce]
    0) install ibus, and/or clean install with any language that need IM subsystem(such as Japanese, Chinese, Korean, Frence..etc.).
    1) log-in Oneiric.
    2) variable GTK_IM_MODULE set as ibus.
       You will see in terminal:
       $ export | grep GTK_IM_MODULE

[expect results]
    When we have /usr/lib/gtk-*.0/*/immodules/im-ibus.so(In Unity environment, that provide as default), using ibus (GTK_IM_MODULE=ibus)

[actual results]
    always use xim (GTK_IM_MODULE=xim)

[side effects by this problem]
    Some IM system needs "candidate" window, that layout by {xim, ibus} modules.
    For historical/technical reason, XIM does not provide enough support about coordinating candidate window, as a result, candidate window show in inconsequence place. That breaks Desktop UX.

[analysis]

That problem caused by /etc/X11/xinit/xinput.d/ibus .
This scripts has bad glob coding as follows:

-------------------------------------------------------
$ cat /etc/X11/xinit/xinput.d/ibus
(..snip..)
if [ -e /usr/lib/gtk-*.0/*/immodules/im-ibus.so ]; then
    GTK_IM_MODULE=ibus
else
    GTK_IM_MODULE=xim
fi
(..snip..)

-------------------------------------------------------

In GTK2/GTK3 dual-stack environments, this glob pattern matches two files(see below). test(1) does not support multiple operand, that will fail with error message "[: 7: /usr/lib/gtk-2.0/2.10.0/immodules/im-ibus.so: unexpected operator", and set GTK_IM_MODULE=xim.

-------------------------------------------------------
$ ls /usr/lib/gtk-*.0/*/immodules/im-ibus.so
/usr/lib/gtk-2.0/2.10.0/immodules/im-ibus.so
/usr/lib/gtk-3.0/3.0.0/immodules/im-ibus.so
-------------------------------------------------------

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: ibus 1.3.9-2ubuntu2
ProcVersionSignature: Ubuntu 3.0.0-8.10-generic-pae 3.0.1
Uname: Linux 3.0.0-8-generic-pae i686
Architecture: i386
Date: Tue Aug 9 18:56:13 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110427.1)
ProcEnviron:
 LANGUAGE=ja:en
 PATH=(custom, user)
 LANG=ja_JP.UTF-8
 LC_MESSAGES=ja_JP.UTF-8
 SHELL=/bin/zsh
SourcePackage: ibus
UpgradeStatus: Upgraded to oneiric on 2011-08-09 (0 days ago)