On Sat, Dec 5, 2009 at 3:01 AM, Doug Rintoul <[email protected]> wrote:

> [email protected] wrote:
> > Comment #3 on issue 671 by Shawn.P.Huang:  Patch to add
> delete-surrounding
> > functionality and fix forward-key-event
> > http://code.google.com/p/ibus/issues/detail?id=671
> >
> > I have applied your patch, and also fixed the gdk_event_free problem. I
> > think the problem is caused by
> > event->string = gdk_keyval_name (keyval), ibus should make a copy of the
> > string returned from
> > gdk_keyval_name. Please test it.
> >
> http://github.com/phuang/ibus/commit/bbd1d1d8573ac14bc73b4a0df639f71aae066bae
> >
> Thanks for this. I have tested it out and it is working great. I kind of
> wondered about gdk_keyval_name and whether ibus needed to make a copy.
> Does gdk_event_free also free the copy or where does it get freed?
>

gdk_keyval_name returns a const gchar *, it should not be free. So I have to
make a copy of it, and the copy will be free in gdk_event_free.

gchar </usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar>*
        gdk_keyval_name                     (guint
</usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint> keyval);

Converts a key value into a symbolic name. The names are the same as those
in the <gdk/gdkkeysyms.h>header file but without the leading "GDK_".

*keyval* :
a key value.

*Returns* :
a string containing the name of the key, or
NULL</usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS>
 if *keyval* is not a valid key. The string should not be modified.


> > BTW, I think gtk does not has a notification event when the context is
> > changed. but ibus im context
> > could get surrounding text from client application after some IME events
> > (commit text, preedit
> > changed, and etc), and check if the surrounding changed, if yes, send the
> > current surrounding text to
> > IME.
> >
> I'll take a look at this next week.
>
> Again thanks for evaluating and applying the patch.
>
> Doug.
>
> --
> You received this message because you are subscribed to the Google
> Groups "ibus-devel" group.
> iBus project web page: http://code.google.com/p/ibus/
> iBus dev group: http://groups.google.com/group/ibus-devel?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "ibus-devel" group.
iBus project web page: http://code.google.com/p/ibus/
iBus dev group: http://groups.google.com/group/ibus-devel?hl=en

回复