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-22 21:33:59 -04:00
parent 5e673e94de
commit d6c45d0e17

View File

@ -1131,7 +1131,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)
{