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: Hidetoshi Tajima <hidetoshi.tajima@eng.sun.com>
Date: Wed, 16 Aug 2000 12:04:05 -0700 (PDT)
To: cathy@mitux.tatung.com.tw, thhsieh@twcpro.phys.ntu.edu.tw
Reply-To: xcin@linux.org.tw

Hi,

First of all, thanks for solving the problem and contributing a new
xcin. That would be a great help.

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.

Please also find out my further comments below:

>1. Mozilla seems still have so-called "X11R5 limitation", just like Netscape
>   communicators. I mean:
>
>   a. The XIM server MUST start before Mozilla, otherwise Mozilla cannot make
>      connection with the XIM server.
>
>   b. During the connection, the XIM server should NOT quit, otherwise this
>      will lead to serious problem on Mozilla such as the Mozilla will just
>      hang, or memory fault, or bus error.
>
>   All of this problem can be solved by the X11R6 programming style. In 
>   short, when making the connection to the XIM server, the client should 
>   not use XOpenIM() directly, instead it should use 
>
>	XRegisterIMInstantiateCallback()
>
>   to register an initial connecting function to Xlib. Then if Xlib find a
>   valid XIM server is available, it will call the initial connecting 
>   function to make the connection to the XIM server. So the problem a. could
>   be solved.
>
>   In the initial connecting function, the client should use XSetIMValues()
>   function to register a destroy_callback function to Xlib. Then when Xlib
>   suddently discover that the connecting XIM server is unavailable, it will
>   use the destroy_callback function to notify the client, then the client
>   can do something to prevent the serious problems occure in b.

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.

>2. When input focus is changed, the Mozilla XIC ssems not report to the XIM
>   server.
>
>   I mean, initially my keyboard input focus is on window A (which is not
>   part of Mozilla; it is just another XIM client). Now I click my mouse
>   to change the input focus to one of the input window of Mozilla, the 
>   Mozilla window HAVE TO call  XSetICFocus()  to report this event to the
>   XIM server. And, if I click my mouse to other window and change the
>   input focus, that Mozilla window HAVE TO call  XUnsetICFocus()  to report
>   this event, too. Otherwise the XIM server will have difficulty to keep
>   trace the statuses of different XIM clients.

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.

>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?

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

Indexed By Date Previous: Re: The XCIN IM tables
From: zw@zhaoway.com
Next: Re: Run with Chinese IME(xcin, CLE) browser hangs.:My platfor
From: Tung-Han Hsieh <thhsieh@twcpro.phys.ntu.edu.tw>
Indexed By Thread Previous: Re: Run with Chinese IME(xcin, CLE) browser hangs.:My platfor
From: Tung-Han Hsieh <thhsieh@twcpro.phys.ntu.edu.tw>
Next: Re: Run with Chinese IME(xcin, CLE) browser hangs.:My platfor
From: Tung-Han Hsieh <thhsieh@twcpro.phys.ntu.edu.tw>