diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-07-29 15:47:04 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-07-29 17:29:25 -0400 |
commit | 539391ce6c5d2271b591c2849c629828af8be154 (patch) | |
tree | 4476053e1b7147d7617ecb9beb7ea72f9b09dfa7 /gtk/gtkimcontextsimple.c | |
parent | b6c0155836d354dc2984c3381147f8cdd66f6325 (diff) | |
download | gtk+-539391ce6c5d2271b591c2849c629828af8be154.tar.gz |
composetable: Change an API
Make gtk_check_algorithmically take a GString
for the result. This is in preparation for allowing
multi-character results here, in the future.
Update all callers.
Diffstat (limited to 'gtk/gtkimcontextsimple.c')
-rw-r--r-- | gtk/gtkimcontextsimple.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c index 8289aad7bc..1803b8e70d 100644 --- a/gtk/gtkimcontextsimple.c +++ b/gtk/gtkimcontextsimple.c @@ -821,7 +821,6 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context, int i; gboolean compose_finish; gboolean compose_match; - gunichar output_char; guint keyval, state; while (priv->compose_buffer[n_compose] != 0 && n_compose < priv->compose_buffer_len) @@ -1132,12 +1131,13 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context, G_UNLOCK (global_tables); - g_string_free (output, TRUE); - if (success) - return TRUE; + { + g_string_free (output, TRUE); + return TRUE; + } - if (gtk_check_algorithmically (priv->compose_buffer, n_compose, &output_char)) + if (gtk_check_algorithmically (priv->compose_buffer, n_compose, output)) { if (!priv->in_compose_sequence) { @@ -1145,14 +1145,18 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context, g_signal_emit_by_name (context_simple, "preedit-start"); } - if (output_char) - gtk_im_context_simple_commit_char (context_simple, output_char); + if (output->len > 0) + gtk_im_context_simple_commit_string (context_simple, output->str); else g_signal_emit_by_name (context_simple, "preedit-changed"); + g_string_free (output, TRUE); + return TRUE; } + g_string_free (output, TRUE); + /* If we get here, no Compose sequence matched. * Only beep if we were in a sequence before. */ |