GNOME Bugzilla – Bug 270248
add support for Surrounding text in input
Last modified: 2006-08-28 14:40:52 UTC
Composer that comes with Evolution 2.0.2 doesn't seem to have surrounding text support (i.e.: gtk_im_context_{get,delete}_surroundings()). Input method modules that use these functions are not working properly. Steps to reproduce the problem: 1. Install any input method that uses surrounding text (e.g.: Sinhala Transliterated input from http://sinhala.linux.lk/pub/ ). 2. Type any key that require surrounding text (say "ki" in Sinhala). This takes each keys individually, and doesn't produce different input depending on the context. The expected result is for some keys to behave differently depending on their surroundings. This is not a random bug.
This is only an i18n bug. The composer needs to deal with doing non-english input correctly obviously
Why did this get marked future? I believe rodo made this work for 2.0, so maybe it regressed or there are still issues.
ok, that indeed doesn't work and triggers assertions (lt-test_editor:28985): Gtk-CRITICAL **: file gtkimcontext.c: line 451 (gtk_im_context_set_surrounding): assertion `text != NULL || len == 0' failed (lt-test_editor:28985): Gtk-CRITICAL **: file gtkimcontext.c: line 451 (gtk_im_context_set_surrounding): assertion `text != NULL || len == 0' failed (lt-test_editor:28985): Gtk-CRITICAL **: file gtkimcontext.c: line 451 (gtk_im_context_set_surrounding): assertion `text != NULL || len == 0' failed but I doubt it's regression.
GTK widgets that input text are supposed to implement gtk_im_get_surrounding and gtk_im_delete_surrounding. Looks like the text composing widget in Evolution composer is not implementing it. We are trying workarounds, and here is a post from Owen Taylor on the matter: http://www.mail-archive.com/gtk-i18n-list@gnome.org/msg00037.html
not mailer code
retargetting to 2.5
It seems surrounding text support has been in 2.7 or before. But it's still buggy. For example, it crashes when actually called, as reported in Bug #353192. However, even the crasher is fixed, there remain a few logical flaws in the code (gtkhtml.c): First, get_surrounding_text() always returns NULL. Everything in it seems OK, except for the line: text = g_strconcat (text, HTML_TEXT (o)->text, NULL); Since "text" was initialized with NULL, g_strconcat() takes the first NULL argument as argument list terminator. Thus, it's always remains NULL along the loop. Besides, even if it is fixed to be non-NULL before that, it will still suffer from memory leak, as the old copy is discarded, replaced by the one newly allocated by g_strconcat(). Second, in gtk_html_im_retrieve_surrounding_cb(), the call to gtk_im_context_set_surrounding() is supplied with character offset as the last argument, while the API requires byte offset.
Created attachment 71761 [details] [review] Patch fixing surrounding text support.
(In reply to comment #8) > Created an attachment (id=71761) [edit] > Patch fixing surrounding text support. > Patch looks good. Please commit it to both HEAD and CVS. Once committed, please mark the patch as committed and close this bug and the other one as well.
Patch committed to HEAD and gnome-2-14 branch. However, I do not have permission to close this bug, nor to update status of my patch.
closing on behalf of thep