imcontext: Fix cursor positions

gtk_im_context_get_preedit_string is documented to
return the cursor position as a character offset,
not a byte count. So return that.

Fixed: #3885
This commit is contained in:
Matthias Clasen
2021-04-21 06:27:26 -04:00
parent 6a95ca6995
commit d35e069436

View File

@@ -1152,7 +1152,7 @@ gtk_im_context_simple_get_preedit_string (GtkIMContext *context,
}
if (cursor_pos)
*cursor_pos = s->len;
*cursor_pos = g_utf8_strlen (s->str, s->len);
if (attrs)
{