summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-07-29 08:39:17 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-07-29 08:39:17 -0400
commitb6c0155836d354dc2984c3381147f8cdd66f6325 (patch)
tree4cea1a301641b62453f101ca20eb6908e570e46a
parent76d67b586c5dc2b19ee4072284fa4fb7f74b01f3 (diff)
downloadgtk+-b6c0155836d354dc2984c3381147f8cdd66f6325.tar.gz
imcontext: Handle Escape in Compose sequence
Treat Escape the same in hex sequences and in Compose sequence: reset the state.
-rw-r--r--gtk/gtkimcontextsimple.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c
index 71f9094aee..8289aad7bc 100644
--- a/gtk/gtkimcontextsimple.c
+++ b/gtk/gtkimcontextsimple.c
@@ -1001,16 +1001,22 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
return TRUE;
}
-
+
+ if (is_escape)
+ {
+ if (priv->in_hex_sequence || priv->in_compose_sequence)
+ {
+ gtk_im_context_simple_reset (context);
+ return TRUE;
+ }
+
+ return FALSE;
+ }
+
if (priv->in_hex_sequence)
{
if (hex_keyval && n_compose < 6)
priv->compose_buffer[n_compose++] = hex_keyval;
- else if (is_escape)
- {
- gtk_im_context_simple_reset (context);
- return TRUE;
- }
else if (!is_hex_end)
{
/* non-hex character in hex sequence, or sequence too long */