Menu

#687 bug in nick completion [IM preedit]

closed-fixed
nobody
None
5
2004-08-07
2004-07-08
Tee
No

In cjk environment, the character doesn't make with
just one input..
so cjk input method has preedit string buffer to keep
the the incomeplete character..

thus, we need gtk_im_context_reset() to commit the
preedit string to gtk_entry_buffer before
gtk_entry_get_text()

:D

Discussion

  • Tee

    Tee - 2004-07-08

    xchat-2.0.10-preeditstring.patch

     
  • Peter Zelezny.

    Peter Zelezny. - 2004-07-08

    Logged In: YES
    user_id=5012

    The problem I see here is that "im_context" is a private
    field. It's illegal to access it directly, since GTK+
    2.5/6/7 might remove or move it.

    Do you know of another way to reset the imcontext?

     
  • Peter Zelezny.

    Peter Zelezny. - 2004-07-14
    • summary: bug in nick completion --> bug in nick completion [IM preedit]
     
  • Peter Zelezny.

    Peter Zelezny. - 2004-07-31

    Logged In: YES
    user_id=5012

    This is my current solution, does it work for you?

    /* force the IM Context to reset */
    gtk_editable_set_editable (GTK_EDITABLE (t), FALSE);
    gtk_editable_set_editable (GTK_EDITABLE (t), TRUE);

    text = GTK_ENTRY (t)->text;
    if (text[0] == 0)
    return 1;

     
  • Tee

    Tee - 2004-07-31

    Logged In: YES
    user_id=1074410

    It works fine :D
    Thanks

    gtk_entry_get_text doesn't return the copied string of
    GTK_ENTRY_BUFFER..
    so we don't need to call gtk_entry_get_text after IM reset.. :D

    diff -urN xchat-2.0.10_org/src/fe-gtk/fkeys.c
    xchat-2.0.10/src/fe-gtk/fkeys.c
    --- xchat-2.0.10_org/src/fe-gtk/fkeys.c 2004-07-31
    16:01:23.136745848 +0900
    +++ xchat-2.0.10/src/fe-gtk/fkeys.c 2004-07-31
    16:02:47.941853512 +0900
    @@ -1371,6 +1371,10 @@
    const char *text = gtk_entry_get_text (GTK_ENTRY (t));
    GCompletion *gcomp = NULL;

    + /* force the IM Context to reset */
    + gtk_editable_set_editable( GTK_EDITABLE (t), FALSE );
    + gtk_editable_set_editable( GTK_EDITABLE (t), TRUE );
    +
    if (text[0] == 0)
    return 1;

     
  • Peter Zelezny.

    Peter Zelezny. - 2004-07-31

    Logged In: YES
    user_id=5012

    But it's safer to get the text pointer after, since you are
    leaving IMs/GTK the freedom to allocate a new buffer (maybe
    some do?). That's how I have it in current CVS.

     
  • Peter Zelezny.

    Peter Zelezny. - 2004-08-07
    • status: open --> closed-fixed
     

Log in to post a comment.