On Thu, Sep 21, 2006 at 01:29:43AM -0000, Matt Zimmerman wrote:
> On Wed, Sep 20, 2006 at 08:55:24AM -0000, Enrico Zini wrote:
> > After a chat with Andrew Lee (upstream maintainer of scim-chewing), I'll
> > try to summarise the situation as concisely as I can:
> 
> Thank you so much.  Your explanation has helped me to reach a breakthrough
> understanding of the situation.

Enrico and Matt, thank you both for taking time to help on the input
method issues.

I am not currently following the development of Ubuntu edgy.  But I was
involved in the dapper development, and I'll pitch in what I know about
these things.

[snipped]
> > Cause of the bug:
> > 
> >   The cause of the bug is that Dapper uses scim-qtimm, which
> >   requires a patch to libqt in order to work.  The patch changes the
> >   API/ABI of libqt.
> > 
> >   Applications built with the patched libqt work fine with
> >   scimm-qtimm, but all 3rd-party applications that weren't built
> >   with the patched libqt do not work with scimm-qtimm.
> 
> OK, so our libqt includes said patch, and this problem is limited to
> third-party Qt applications not distributed with Ubuntu?

That's true as far as I understand.

> > Further issues:
> > 
> >   scim-0.2.1 in dapper has a nasty bug: the user's phrase database
> >   file gets corrupted when scim does not exit gracefully.  After
> >   this happens, it's impossible to input Chinese.
> > 
> >   The bug is fixed on 0.3.1.  It's unfortunately hard to backport
> >   the patch, because the fix consisted in rewriting the code that
> >   handles the user database.
> 
> My input method vocabulary is a bit limited; here is what I think I
> know:
> 
> scim - input method platform used in Ubuntu
> scim-qtimm - input method plugin for Qt which talks to SCIM

I believe the correct description is "a plugin that Qt apps talks to,
which handles user's input in the app,  and then talks to lower-level Qt
libraries to deal with these (maybe already modified) input".  But I am
not positive that I understand the technical part very well.

You probably also want to know about scim-gtk2-immodule, which is the
counterpart plugin on GTK+ side.

> scim-chewing - the default Chinese input method used in Ubuntu

Traditional Chinese (Taiwan) input method.  Simplified Chinese (Mainland
China) use different input methods.

> xim - an X protocol for input methods, used by SCIM
> im-switch - a framework which selects input methods at login, based on locale
> 
> If I apply these definitions to what you've said, here's my current
> understanding:
> 
> - Most programs talk to SCIM via the X server's XIM protocol

My (limited) understanding says that programs using XIM protocol doesn't
talk to SCIM directly, they talk to some kind of general "XIM server",
of which SCIM is one.  The X server take the user input and give them to
the XIM server, then take the output of the XIM server and give them to
lower-level X libraries to process.

> - GTK and Qt programs may instead use a plugin which talks to SCIM by some
>   other means

Yes, essentially GTK and Qt has their own input method framework which
replaces XIM protocol (although they can use XIM in their framework).

> - In Dapper, scim-chewing instructs im-switch to select the following input
>   method settings for Chinese:
>   - Run SCIM in the user's session

(All my following comments are based on what I see in dapper's
scim-chewing 0.2.1-2ubuntu4 source package.)

Only for Ubuntu.  For Kubuntu it runs skim, which is a different program
written for KDE (as scim is a GTK program).  But skim is also use the
SCIM framework.

>   - Tell GTK to use the native SCIM input method module (scim-gtk2-immodule)
>   - Tell Qt to use the native SCIM input method module (scim-qtimm)

These are correct.

>   - X programs not using GTK or Qt will use XIM, which should still reach
>       SCIM (right?)

By what I have seen, no.  scim-chewing package doesn't seem to set the
proper environment (the XMODIFIERS env variable) for XIM, so I don't
think the non-GTK/Qt X programs will work if the im-switch setting is
done by scim-chewing.

> - scim can't be used with Qt applications unless a patched Qt and scim-qtimm
>   are used, so this configuration doesn't work with those.

This is actually not true.  scim can be used with Qt applications in XIM
protocol, with unpatched or patched Qt, with or without scim-qtimm.  The
Qt patch is needed by scim-qtimm, not by SCIM itself.

>                                                             This applies to
>   all Qt applications when SCIM is in use, and this is the bug described in
>   the original report here.

I believe only third-party Qt applications, as they assume a different
Qt API/ABI.  But only when scim is instructed to use scim-qtimm.  When
using XIM I believe things work fine.

> - Ubuntu does not ship with scim-qtimm, so even if the previous problem were
>   fixed, Chinese input in Qt programs in Ubuntu doesn't work.

If the setting is proper, Qt programs should be able to use SCIM through
XIM protocol when scim-qtimm is absent.

> - Kubuntu does not ship with scim-gtk2-immodule, so Chinese input in GTK
>   programs in Kubuntu doesn't work.

And ditto here.  With proper setting, GTK programs in Kubuntu can use
scim through XIM protocol.

[snipped] 
> Things I still don't understand:
> 
> - How is scim-pinyin relevant to this discussion?

scim-pinyin is one of the main input method used by simplified Chinese.
Its position is similar to scim-chewing in the above discussions.  There
are probably similar bugs there, but it really should belong to a
separate bug.

> - How will the user experience change when XIM is used instead of
>   scim-qtimm?  Does the user still get the same functionality?  If so, what
>   purpose does this module (and the corresponding GTK module) serve?

I think this is a very complicated question and quite hard to answer.
Wen-Yen Chuang gave his opinions elsewhere in this bug, but I don't
completely agree with him.  I like XIM quite much and I don't think
GTK/Qt immodules have a clear advantage.  That's just my personal
opinion, though.  And since this is IMO tangential to this bug, I won't
say much.  Probably later, in a different bug.

> - Why is it the scim-chewing package which controls which input methods are
>   selected for Chinese?  Shouldn't this be done at a higher level?

The main reason is that the im-switch settings are based on locale.  As
it would be improper for scim to set input method for all locales (since
it can only supports input for traditional Chinese when scim-chewing is
installed), you need some special settings in scim-chewing package.

However I do believe the settings should be done as much as possible at
a higher level, and I believe that would be in scim package.  I did work
on scim to provide generalized im-switch support during dapper
development, however that was achieved pretty late, and well after other
people had finished putting im-switch settings in their
language-specific scim packages.  And I didn't have time to check all
other packages or persuade other people to adjust their changes to
accommodate the settings in scim.  I was not, and still am not sure my
idea of centralized im-switch setting is shared by other CJK developers
in Ubuntu.

> - It seems to be implied that our Qt is API/ABI incompatible with other
>   platforms due to the patch to support scim-qtimm.  Is that true?

Incompatible with Qt upstream, for sure.  However this patch is quite
popular among distros.  Debian etch is going to have this patch, the
changes were made first in version 3:3.3.5-4.

[snipped]

Hope this helped a little.  Thanks again, especially to Matt, for
spending your precious time understanding and trying to solve such a
complex issue.

Ming, Debian maintainer for scim
2006.09.21

-- 
scim-chewing cannot enter any Chinese character
https://launchpad.net/bugs/57081

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to