projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7738a05
)
imwayland: Fix get_preedit_string cursor position
author
xdavidwu
<xdavidwuph@gmail.com>
Fri, 17 Jan 2020 08:01:01 +0000
(16:01 +0800)
committer
xdavidwu
<xdavidwuph@gmail.com>
Fri, 17 Jan 2020 08:16:13 +0000
(16:16 +0800)
GtkIMContext get_preedit_string should return cursor position counted
in characters, but cursor_begin here is counted in bytes. This add the
missing conversion.
gtk/gtkimcontextwayland.c
patch
|
blob
|
history
diff --git
a/gtk/gtkimcontextwayland.c
b/gtk/gtkimcontextwayland.c
index 3344a68cad5ee355d802127a3da1e7c2ca0d7f3e..4fcc2f9a01b9b0bfca26dbc887675501ceb202d8 100644
(file)
--- a/
gtk/gtkimcontextwayland.c
+++ b/
gtk/gtkimcontextwayland.c
@@
-592,7
+592,8
@@
gtk_im_context_wayland_get_preedit_string (GtkIMContext *context,
if (str)
*str = g_strdup (preedit_str);
if (cursor_pos)
- *cursor_pos = context_wayland->current_preedit.cursor_begin;
+ *cursor_pos = g_utf8_strlen (preedit_str,
+ context_wayland->current_preedit.cursor_begin);
if (attrs)
{