|
Bugzilla – Full Text Bug Listing |
| Summary: | tcl/tk 8.4.11 doesn't support XIM very well. | ||
|---|---|---|---|
| Product: | [openSUSE] SUSE LINUX 10.0 | Reporter: | Zhe Su <zsu> |
| Component: | X11 Applications | Assignee: | Reinhard Max <max> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Normal | ||
| Priority: | P5 - None | CC: | burnus, liucougar |
| Version: | Beta 3 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Found By: | Other | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: |
First attempt of a patch to make Tk work with SCIM
A patch against tk cvs head to fix the SCIM XIM issue. |
||
|
Description
Zhe Su
2005-04-13 07:57:18 UTC
Yes, it is known, that XIM support in Tk is far from being perfect, but unfortunately the Tcl community is lacking people with good skills in XIM programming and personal need to have it working. Would you be able to help me updating that patch to work with Tcl/Tk 8.4 and 8.5? I can try to port this patch. But I don't know if I have time to do it. Anyway, I'll try to finish it before the next SL release. Maybe we can work together on this. I know Tcl and Tk internals fairly well, and have contacts to the Tcl community, in case questions arise. Ok. I'll ask for your help if I encounter any issue. I've chatted with the Tcl/Tk release manager last night, and told him about this patch. He said he thinks it has already been merged into the official Tcl/Tk releases before 8.4. Hi, I checked the source code of tcl/tk 8.4.9 but could not find any improved code similar with the patch. Hmm - maybe only parts of it have been integrated, or even reimplemented. At least there has been improvement in XIM support between 8.3.1 and 8.4.x . max> At least there has been improvement in XIM support between 8.3.1 max> and 8.4.x . kinput2 works with over the spot mode now. In some older version sof Tcl/Tk it worked only with root mode. But that seems to be the only improvement, even with kinput2 the input is difficult because the preedit strings are unreadably small. And I can confirm that it doesn't work at all with scim. scim is our default and most important input method now, therefore this is really quite bad. I keep kinput2 only for historical reasons because some users are very used to the behaviour of kinput2. But scim is much better and much more important. It seems that an easy way for Reinhard Max to reproduce
that SCIM doesn't work is to try using the Compose support
built into SCIM with Tcl/Tk, this doesn't work either:
scim -d
export XMODIFIERS=@im=SCIM
then start some tk application and try to use compose.
*** Bug 104557 has been marked as a duplicate of this bug. *** Is there the plan to create a script "/usr/bin/wish" which contains: ------------ #!/bin/sh XMODIFIERS=xim exec /usr/bin/wish8.4 "$@" ------------ as a work around for 10.0? Yes, but I'll patch it into Tk itself instead of creating a wrapper script, and I'll only overwrite XMODIFIERS when it's value is "@im=SCIM" . Tobias Burnus> XMODIFIERS=xim
This is not a valid setting for XMODIFIERS.
Valid settings look like XMODIFIERS="@im=<name-of-xim-server>".
for example:
XMODIFIERS=@im=local (means use Compose)
XMODIFIERS=@im=SCIM (means use SCIM)
XMODIFIERS=@im=kinput2 (means use kinput2)
...
Reinhard> Yes, but I'll patch it into Tk itself instead of creating a wrapper Reinhard> script, and I'll only overwrite XMODIFIERS when it's value is Reinhard> "@im=SCIM" . In the long run it should be fixed properly though. With this hack, SCIM cannot be used with Tk. Of course this hack is better than not being able to input anything, not even ASCII. But it is a pity that our default input method cannot be used with Tk. Tk is the only program I know of which works with "old" input methods like "kinput2" but not with scim. And even when using kinput2 it is far from perfect. What if I just unset it, if I find it to be "@im=SCIM" when Tk starts up? Better set it to "@im=local". When XMODIFIERS is unset, it can still mean that a XIM server is used under some circumstances. For example: If running in en_US.UTF-8 locale and a file like /usr/X11R6/lib/X11/locale/en_US.UTF-8/Compose does *not* exist (it exists on SuSE Linux), *and* exactly one XIM server is running (for example only kinput2 or only SCIM are running), than that XIM server will be used. This is a weird, rare case which probably cannot happen in practice because most subdirectories in /usr/X11R6/lib/X11/locale/ have a "Compose" file. But it is probably better to set "@im=local" instead of unsetting it. Of course should it be fixed properly, but I doubt the Tk community will do so any time soon, because (a) nobody there knows how to do it, and (b) nobody there has a pressing need to get it fixed. Most Tk hackers don't need XIM at all and those who do don't use SCIM. BTW, I recently tried the patch mentioned in comment #1 on the 8.3.1 sources, and it worked with SCIM. Does it look difficult to port that patch to 8.4.9? I've just started an attempt to port it, and it looks more promising than I had expected, given the set of changes that went into that area of Tk between 8.3.1 and 8.4.11. I'll continue tomorrow... I've just submitted a first version of the forward-ported patch for inclusion in 10.0 . It still has a little focus problem, which I will look into on Monday. After the next ftp sync test packages for the 10.0 betas will be available under ftp://ftp.suse.com/pub/projects/tcl/tk8.4.11 . Tobias, and Zhe, could you please test it over the weekend, so that we can decide if it is good enough for putting it into 10.0 so late in the development cycle? Thanks. Created attachment 48662 [details]
First attempt of a patch to make Tk work with SCIM
Adding the patch to this bug report so that others from the Tcl community can
test it without having to download my RPMs.
Add Liu Cougar <liucougar@gmail.com> to CC:. For 10.0, I took out the patch from comment #22, because it had some focus problems: entering composed characters, and using an IM server was only possible when the mouse pointer was over the widget that has the keyboard focus. Instead I added a workaround that calls XSetLocaleModifiers("@im=local") if it finds SCIM to be used. Overwriting the XMODIFIERS environment variable as discussed above was rejected, because it would also have switched off SCIM for (possibly non-Tk) child processes of a Tk application. Created attachment 61935 [details]
A patch against tk cvs head to fix the SCIM XIM issue.
It's a patch from a Taiwan engineer (Jim Huang) for tk cvs head to fix support issue of SCIM XIM server. I tested it and it works ok.
I think it's simple enough to be committed into tk cvs head.
I've applied the patch to Tk 8.4.12 from STABLE, and it works perfectly with SCIM. Thanks a lot, Zhe. I'll now apply it to HEAD and the 8.4 branch of the Tk CVS. BTW, this patch appears to be the work of Joe English from the Tcl Core Team: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=905830&group_id=12997 |