diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-07-13 17:08:59 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-07-13 17:08:59 -0400 |
commit | ed851504f0f0110881c0f90f93a7dc2e580444d5 (patch) | |
tree | 8386cb417b9f301d4ce17d593928df5157de426c | |
parent | f9c2b708129266e09193930d90de1016ee9235ce (diff) | |
download | gtk+-preedit-highlight.tar.gz |
imwayland: Pass cursor region via attributespreedit-highlight
Use the new Pango attribute to communicate
the cursor region to the widgets.
Fixes: #5035
-rw-r--r-- | gtk/gtkimcontextwayland.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gtk/gtkimcontextwayland.c b/gtk/gtkimcontextwayland.c index 069070509a..6cee3bd022 100644 --- a/gtk/gtkimcontextwayland.c +++ b/gtk/gtkimcontextwayland.c @@ -656,11 +656,10 @@ gtk_im_context_wayland_get_preedit_string (GtkIMContext *context, if (context_wayland->current_preedit.cursor_begin != context_wayland->current_preedit.cursor_end) { - /* FIXME: Oh noes, how to highlight while taking into account user preferences? */ - PangoAttribute *cursor = pango_attr_weight_new (PANGO_WEIGHT_BOLD); - cursor->start_index = context_wayland->current_preedit.cursor_begin; - cursor->end_index = context_wayland->current_preedit.cursor_end; - pango_attr_list_insert (*attrs, cursor); + attr = gtk_im_context_preedit_attr_new (GTK_IM_CONTEXT_PREEDIT_CURSOR); + attr->start_index = context_wayland->current_preedit.cursor_begin; + attr->end_index = context_wayland->current_preedit.cursor_end; + pango_attr_list_insert (*attrs, attr); } } } |