GNOME Bugzilla – Bug 266206
Bunch of input method fixes
Last modified: 2008-03-11 15:35:02 UTC
Here are a bunch of fixes I found while reading through the input method code in gtkhtml.c. Easiest to just quote the ChangeLog entry from the patch Fri Sep 17 13:50:19 2004 Owen Taylor <otaylor@redhat.com> * gtkhtml.c (gtk_html_im_retrieve_surrounding_cb): Fix chars/bytes confusion for cursor_index parameter of gtk_im_context_set_surrounding(). * gtkhtml.c (get_surrounding_text): Fix problem where we'd call gtk_im_context_set_surrounding() with an uninitialized value for offset. * gtkhtml.c (unrealize): Set IM context client window to NULL, not to widget->window. * gtkhtml.c (gtk_html_im_delete_surrounding_cb): Handle the case where offset < 0 and n_chars < -offset. * gtkhtml.c (gtk_html_im_preedit_changed_cb): Fix chars/bytes confusion for returned cursor position for gtk_im_context_get_preedit_string()
Created attachment 44218 [details] [review] Patch with fixes
Turns out that part of this patch is wrong ... the documentation for GtkIMContext is wrong ... cursor position is in characters, not bytes.
adding patch keyword
is just the gtk_im_context_get_preedit_string with position in characters or is also get/set surrounding taking character position as well?
hmm... any news on this? i'm setting this to needinfo and going to punt the target milestone from 2.1 to 2.3 to get rid of all those old ones.
oewn: *poke*
I don't know much about input methods, but I had a look at Owen's patch. Parts of it still look valid. The GtkIMContext documentation appears to have been corrected, so I'm basing my review on it. gtk_html_im_retrieve_surrounding_cb: This part has already been fixed. get_surrounding_text: This part is correct and still valid. unrealize: This part has already been fixed. gtk_html_im_delete_surrounding_cb: Looks right, as far as I can tell. gtk_html_im_preedit_changed_cb: I don't think this is right. gtk_im_context_get_preedit_string() returns the cursor position in characters.
Created attachment 106756 [details] [review] Revised patch Here's the remaining pieces of the original patch that are still valid. Approving for post-GNOME 2.22.0 commit.
Committed to trunk (revision 8778).