imcontext: Enable font fallback for preedit

Not doing so only invites hexboxes.

Fixes: #3678
This commit is contained in:
Matthias Clasen 2021-02-17 22:08:43 -05:00
parent 35488959b4
commit 05fe2441a7
2 changed files with 11 additions and 1 deletions

View File

@ -945,7 +945,14 @@ gtk_im_context_simple_get_preedit_string (GtkIMContext *context,
if (s->len)
{
PangoAttribute *attr = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
PangoAttribute *attr;
attr = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
attr->start_index = 0;
attr->end_index = s->len;
pango_attr_list_insert (*attrs, attr);
attr = pango_attr_fallback_new (TRUE);
attr->start_index = 0;
attr->end_index = s->len;
pango_attr_list_insert (*attrs, attr);

View File

@ -610,6 +610,9 @@ gtk_im_context_wayland_get_preedit_string (GtkIMContext *context,
*attrs = pango_attr_list_new ();
pango_attr_list_insert (*attrs,
pango_attr_underline_new (PANGO_UNDERLINE_SINGLE));
/* enable fallback, since IBus will send us things like ⎄ */
pango_attr_list_insert (*attrs,
pango_attr_fallback_new (TRUE));
if (context_wayland->current_preedit.cursor_begin
!= context_wayland->current_preedit.cursor_end)
{