Bug 405236

Summary: scim: abnormal keyboard input when English is disabled
Product: [openSUSE] openSUSE 11.0 Reporter: Jan Engelhardt <jengelh>
Component: X11 ApplicationsAssignee: Mike Fabian <mfabian>
Status: VERIFIED INVALID QA Contact: Stefan Dirsch <sndirsch>
Severity: Normal    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: x86   
OS: Linux   
Whiteboard:
Found By: Beta-Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Jan Engelhardt 2008-07-01 05:19:25 UTC
The Compose key seems to have no effect with SUSE 11's Xorg 7.3. I have chosen "Menu is Compose" from SaX2, and running `xev` shows that Menu is now the "Multi_key" sym instead of "Menu". However, inputting <Compose><"><a> gives me "a not ä. xorg.conf contains

  Option       "XkbOptions" "grp:ctrls_toggle,compose:menu,eurosign:e"

So I am suspecting that the compose tables were not loaded. How do I check?
Comment 1 Stefan Dirsch 2008-07-01 16:51:46 UTC
I cannot reproduce this issue.
Comment 2 Jan Engelhardt 2008-07-01 16:53:29 UTC
How can I dump the loaded compose table?
Comment 3 Stefan Dirsch 2008-07-01 17:15:08 UTC
Depends on the locale, but probably it's /usr/share/X11/locale/en_US.UTF-8/Compose.
Comment 4 Jan Engelhardt 2008-07-01 17:17:46 UTC
I thought of something like `xmodmap -pke`, but for the table that is currently loaded, not the one on-disk.
Comment 5 Stefan Dirsch 2008-07-01 17:21:21 UTC
I'm not aware of such a command for printing the current compose table.
Comment 6 Jan Engelhardt 2008-07-01 17:27:00 UTC
It turned out that scim mucked around with the keyboard interpretation. Disabling it "solved" the issue. (I just nuked ~/.scim and now I'll find my way through.)
Comment 7 Mike Fabian 2008-07-01 17:39:21 UTC
Compose should work even when scim is running though¹, and it *does*
work for me.  Scim has it’s own build-in Compose support which is
unfortunately hardcoded and implements the contents of
/usr/share/X11/locale/en_US.UTF-8/Compose a few years ago.  That
means, all Compose-sequences which have not been changed recently work
with scim as well.

James Su implemented it this way because he thought that parsing
the Compose table at runtime would be too slow.

I have recently written a Perl-script to generate the source files for
scim used for the hardcoded Compose support from the
/usr/share/X11/locale/en_US.UTF-8/Compose which is available at build
time. That is somewhat better because scim then uses the same Compose
table which was on the system where scim was compiled.  Still not
perfect though because somebody could edit the Compose table later,
but I think this is very rare. A user specific compose table in
~/.XCompose will currently also fail to work with scim because this is
not parsed when scim starts either.

Footnote:
=========
¹ except when scim-bridge is used, i.e. when QT_IM_MODULE=scim-bridge
is used with a Qt3 or Qt4 appliction or GTK_IM_MODULE=scim-bridge is
used with a GTK2 application. There seems to be a problem with
scim-bridge.

Comment 8 Jan Engelhardt 2008-07-01 17:47:53 UTC
The compose support scim provides is good to go... but here is how to reproduce the "bug":


Have scim, scim-anthy and anthy installed. Open scim-setup, go to "IMEngine > Global Settings", disable the entire "Other" category (which contains "English" and "RAW Code"). Save, and restart X and/or scim.

(SCIM by default is not 'active' and one uses Ctrl-Shift-Ins to toggle it; but the daemon runs indeed.)

So, having disabled the Other category, English layout still works, but without Compose table and without Ctrls_toggle (see bug #405237). In fact, SCIM even offering English while one can "deactivate" it (by means of C-S-Ins) is really confusing because you have

- the English mapping when SCIM is inactive (and I thought that this is the normal Xorg keymap)

- the English mapping when SCIM is active

In fact, there are two ways to switch from, say, Japanese to English - either deactivating SCIM by means of C-S-Ins, or by switching to the English method using Ctrl-Alt-Down (I think that was the default).
Comment 9 Jan Engelhardt 2008-07-01 17:52:11 UTC
If SCIM is toggled off, I'd wish it would just pass all keys, except obviously its toggle shortcut, down (or up?) to the X server and leave X with doing the compose. This should not be slow, would it?
Comment 10 Mike Fabian 2008-07-01 18:14:20 UTC
Jan Engelhardt> If SCIM is toggled off, I'd wish it would just pass
Jan Engelhardt> all keys, except obviously its toggle shortcut, down
Jan Engelhardt> (or up?) to the X server and leave X with doing the
Jan Engelhardt> compose. This should not be slow, would it?

That is not possible because the Compose support in X11 is also
a type of XIM input method.

    XMODIFIERS=@im=local

means to use compose

    XMODIFIERS=@im=SCIM

means to use scim. And only one XIM input method can be used
at the same time. Therefore, input methods like "kinput2" which
did not implement their own Compose support, made using
Compose completely impossible. The only XIM input methods
which keep Compose support available are those which implement
Compose support themselves. Currently the only ones I know which
do that are scim and uim.

Comment 11 Stefan Dirsch 2008-07-01 18:47:14 UTC
scim --> X11apps
Comment 12 Mike Fabian 2008-07-28 13:41:56 UTC
I have to close this bug as invalid because as I explained in comment
#10, compose support is also a sort of XIM input method and only one
XIM input method can be used at the same time.

Therefore, if scim is running *and* XMODIFIERS=@im=SCIM then
you get compose only by using the build in compose support of scim.
And by doing the following:

Jan Engelhardt> So, having disabled the Other category, English layout
Jan Engelhardt> still works, but without Compose table

you disable this built in compose support.

If you want to use the compose support of X11, you have to set
XMODIFIERS=@im=local, but then you cannot use scim. You can choose
that separately for each application:

    XMODIFIERS=@im=local program

→ the program uses X11 compose support (no scim available)

    XMODIFIERS=@im=scim program

→ the program uses the compose support of scim (no X11 compose
  support available).

→ INVALID.