[gtk/input-tweaks: 1/7] imcontext: Tweak Compose sequence preedit




commit b7e69226050965032b056b49ca4d5eef2b959af4
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jul 29 07:36:48 2021 -0400

    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

 gtk/gtkimcontextsimple.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]