bug in nick completion [IM preedit]
Brought to you by:
zed
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
xchat-2.0.10-preeditstring.patch
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?
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;
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;
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.