From: Matthias Clasen Date: Thu, 29 Jul 2021 11:36:48 +0000 (-0400) Subject: imcontext: Tweak Compose sequence preedit X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~1^2~43^2~7 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b7e69226050965032b056b49ca4d5eef2b959af4;p=gtk4.git imcontext: Tweak Compose sequence preedit When sequences contain multiple Compose keys, don't hide the first one. This is a very fringe case, but it matches the behavior of IBus. Fixes: #4124 --- diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c index 7183205646..f193eb48e3 100644 --- a/gtk/gtkimcontextsimple.c +++ b/gtk/gtkimcontextsimple.c @@ -1195,12 +1195,14 @@ gtk_im_context_simple_get_preedit_string (GtkIMContext *context, if (priv->compose_buffer[i] == GDK_KEY_Multi_key) { /* We only show the Compose key visibly when it is the - * only glyph in the preedit, or when it occurs in the + * only glyph in the preedit, or when the sequence contains + * multiple Compose keys, or when it occurs in the * middle of the sequence. Sadly, the official character, * U+2384, COMPOSITION SYMBOL, is bit too distracting, so * we use U+00B7, MIDDLE DOT. */ - if (priv->compose_buffer[1] == 0 || i > 0) + if (priv->compose_buffer[1] == 0 || i > 0 || + priv->compose_buffer[i + 1] == GDK_KEY_Multi_key) g_string_append (s, "·"); } else