Great Circle Associates

XCIN Mail-list
(August 2000)


Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: Run with Chinese IME(xcin, CLE) browser hangs.:My platfor
From: Tung-Han Hsieh <thhsieh@twcpro.phys.ntu.edu.tw>
Date: Sat, 19 Aug 2000 15:40:22 +0800
To: cathy@mitux.tatung.com.tw
Reply-To: xcin@linux.org.tw
User-Agent: Mutt/1.0.1i

----- Forwarded message from Tung-Han Hsieh <thhsieh> -----

Date: Sat, 19 Aug 2000 15:38:42 +0800
From: Tung-Han Hsieh <thhsieh>
To: Hidetoshi Tajima <hidetoshi.tajima@eng.sun.com>
Subject: Re: Run with Chinese IME(xcin, CLE) browser hangs.:My platfor
User-Agent: Mutt/1.0.1i
In-Reply-To: <0FZE009OWFO2S0@ha-sims.eng.sun.com>; from hidetoshi.tajima@eng.sun.com on Wed, Aug 16, 2000 at 12:04:05PM -0700

On Wed, Aug 16, 2000 at 12:04:05PM -0700, Hidetoshi Tajima wrote:
> First of all, thanks for solving the problem and contributing a new
> xcin. That would be a great help.

Thank you very much for your comments. And very sorry that I reply this
mail late once again. In the following is my comments about these probelm.

> As to your report regarding to the XIM problems, I wonder if you have a chance
> to look at actual implementation in mozilla to deal with XIM. If not, please
> take a moment to find them in mozilla/widget/src/gtk/. nsWidget.cpp,
> nsWindow.cpp, nsGtkEventHanlder.cpp, and nsGtkIMEHelper.cpp are the sources
> including XIM related codes.
> 
> You will find that XIM functions such as XOpenIM, XCreateIC, XFilterEvent
> are not directly called there, but they are called indirectly through the
> wrapper functions in gtk+/gdk. (Only exception is calling XSetICValues
> to set preedit and status callback attributes. They are necessary to
> be done in mozilla, because gtk+/gdk does not handle XIMCallback input
> style at all.)
> 
> Under such circumstances, I would say the problems you reported may not be
> solved in mozilla side, but may require the fixes in gdk/gtk+ side.
[deleted ....]
> 
> Both should be done in gdk_im_open() of gtk+/gdk libraries if you have built
> the libraries with both -DUSE_XIM and -DUSE_X11R6_IM. The source filename for
> gdk_im_open() is gtk+1.2.X/gdk/gdkim.c.
> 
> Please double-check your GTK+ libraries, and let me know even if the problem
> happens even the properly built ones.

I follow your suggestion to rebuild gtk+-1.2.7 and test once again, both of
the problems I mentioned in my past mail, i.e., the so-called X11R5 problem
and IC focus change problem still remain. As you said, these might not the
problem of mozilla, but should be the gtk side. I am not sure. I think I 
should look into gtk more detailly first, then come back to mozilla.

Now I will report more detailed situation about these two problems. I will
take the latest xcin-2.5 version as the XIM server. And I will take the
URL input window of the "WEBSHELL+ = 1" (i.e., the html page browser) as
the XIM client during the test.

1. When xcin starts first, then mozilla, if now I terminate xcin, the mozilla
   will definitely crash, with the message like this:

Gdk-ERROR **: BadWindow (invalid Window parameter)
  serial 5553 error_code 3 request_code 18 minor_code 0
Gdk-ERROR **: BadWindow (invalid Window parameter)
  serial 5555 error_code 3 request_code 25 minor_code 0

2. If I start mozilla first, and then xcin, I can see that xcin receves some
   XIM related messages from mozilla, i.e., the XIM client begins to connect
   to xcin. But the connect seems not complete, because when I put the input
   focus into the URL input window, I cannot switch into Chinese language
   input mode by the XIM trigger keys, and xcin side will not receive other
   XIM messages furthermore.

   But now if I use mouse to do some actions (like click other part of 
   mozilla window, or move the mozilla window, or others), then the URL
   window might start the actual connection to xcin, and I can press the
   trigger keys to switch to the Chinese input mode.

>From the above 2 points, it seems to me that gtk actually have used
XIMInstantiateCallback() to register the initial connecting function
of the client side, but some how it cannot handle the X events very
properly. Therefore, even it has followed the X11R6 programming suggestion,
but still has problems.


3. For the focus problem, I see that when I use mouse to change the input
   focus between parts of mozilla, xcin really received the XSetICFocus
   or XUnsetICFocus message from mozilla. But, if I change the input focus
   between and the other XIM client which is NOT part of mozilla, xcin
   will not receive the focus change message from mozilla.

> Are you saying that your XIM server does not get SET_IC_FOCUS or UNSET_IC_FOCUS
> requests from mozilla? Actually, they should be issues through gdk_im_begin()
> and gdk_im_end(), and my XIM server can get the requests from mozilla.
> 
> BTW, it is not always true that you gets UNSET_IC_FOCUS() from the XIM client.
> Actually, no QT client does, so I'd like to suggest you not to reply on 
> SET_IC_FOCUS and UNSET_IC_FOCUS too much.

Hmmm, I personally do not agree. The SET_IC_FOCUS and UNSET_IC_FOCUS should
always be sent by the client. It is a important XIM programming part which
is defined in X. For a XIM server which can do complex contexts switching
between different XIM clients, it is very important to get the focus messages
from the clients, otherwise it will have difficult to trace the current 
status of these clients.

However, as you said, not all of the clients will send the focus messages
to the server, so I will try to work around this from xcin side, as much
as I can do.


> >These are the major problem I found up to now. I suggest that you could 
> >look into these and try to work around on them. In the xcin source code
> >(such as xcin-2.5.2-pre4.tar.gz I just mentioned) there is a very simple
> >XIM client:
> >
> >	xcin-2.5/src/util/testprog/testprog.c
> >
> >which could serve as an example on XIM programming. It does not have the
> >problems I mentioned above. So you can take a look at it if you need.
> 
> Thanks. I'll look into the test program and see what we can do in mozilla
> side. I appreciate your great help.
> 
> regards,
> -toshi
> 
> P.S. Do you have a time on mozilla XIM bug fixing?

Sorry, I am not sure. As I mentioned, this might not be the bug of mozilla
side, but the gtk side. Therefore, I would like to look into gtk first and
then come back. And, now I have no experience on gtk and the APs using it, so
I need time to be familiar with them. :-))) But if you find any problem of
xcin side when developing mozilla, please feel free to tell me. I actually
need more feedback to improve the quality of XIM part of xcin. :-))

Best Regards,


T.H.Hsieh

----- End forwarded message -----
To Unsubscribe: send mail to majordomo@linux.org.tw
with "unsubscribe xcin" in the body of the message

Indexed By Date Previous: Re: Run with Chinese IME(xcin, CLE) browser hangs.:My platfor
From: Hidetoshi Tajima <hidetoshi.tajima@eng.sun.com>
Next: got a problem ......
From: Yuan Chang-Ann <cayuan@yahoo.com>
Indexed By Thread Previous: Re: Run with Chinese IME(xcin, CLE) browser hangs.:My platfor
From: Hidetoshi Tajima <hidetoshi.tajima@eng.sun.com>
Next: got a problem ......
From: Yuan Chang-Ann <cayuan@yahoo.com>