I am trying to get AbiWord to work with my XIM (X-Windows Input Method) under
Linux with Gtk-2.0.  Documentation is unhelpful, both for Gtk and for AbiWord,
but I have figured out I need to do the following (shown in csh syntax):

        setenv GTK_IM_MODULE xim
        setenv XMODIFIERS @im=keypress

The first tells Gtk that it should use an external XIM.  Gtk has some builtin
XIM modules, such as im-cyrillic-translit, but I want to use my own, which
registers itself to the X server as "keypress".  Hence the second setenv.

The good news:  When I start AbiWord, my XIM module prints debugging output
that shows that it is being contacted by AbiWord.  In fact, AbiWord (or rather
the Gtk component) makes 4 connections to it!  This fact, and the Gtk
documentation, imply that Gtk has been compiled with XIM support turned on.

The bad news:  I can't get my trigger key (which is the traditional
shift-space) to trigger XIM mode.  Similarly, I can't find a trigger key for
cyrillic.  

I thought the problem might be in af/xap/unix/xap_UnixFrameImpl.cpp, in routine
XAP_UnixFrameImpl::_fe::key_press_event(), which has comments about only
handing certain keypresses to Gtk.  I added a case to have this routine return 0
for shift-space in addition to the few others it passes:

    if (e->state & GDK_SHIFT_MASK && (e->keyval == (guint) ' '))
                return 0;

I have verified with gdb that my code in fact returns 0 on shift-space
and that it returns to Gtk code.  But I don't get a trigger to my XIM, and
in fact my XIM is not hearing any further communication from AbiWord until I
close AbiWord, at which point it gets four XIM_DESTROY_IC messages.

Another potential cause of problem is that the XIM might not be accepting the
particular kind of connection that Gtk wants to make.  But I get the same
behavior even if I have my XIM accept all possibilities:

        XIMPreeditArea|XIMStatusArea,
                XIMPreeditCallbacks|XIMStatusCallbacks,
                XIMPreeditPosition|XIMStatusArea,
                XIMPreeditPosition|XIMStatusNothing,
                XIMPreeditNothing|XIMStatusNothing,

What do I need to do to get Gtk to communicate with my XIM?

Raphael

Reply via email to