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
This commit is contained in:
Matthias Clasen
2021-07-29 07:36:48 -04:00
parent db8b3419c2
commit b7e6922605

View File

@@ -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