[gtk/preedit-highlight: 3/3] imwayland: Pass cursor region via attributes
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/preedit-highlight: 3/3] imwayland: Pass cursor region via attributes
- Date: Wed, 13 Jul 2022 21:09:58 +0000 (UTC)
commit ed851504f0f0110881c0f90f93a7dc2e580444d5
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Jul 13 17:08:59 2022 -0400
imwayland: Pass cursor region via attributes
Use the new Pango attribute to communicate
the cursor region to the widgets.
Fixes: #5035
gtk/gtkimcontextwayland.c | 9 ++++-----
1 file 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);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]