diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-08-18 15:42:56 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-08-18 15:44:45 -0400 |
commit | 24174e5528018c36868c4e4f834a8614b460bafb (patch) | |
tree | 9bab8fa9319fd1b8a1ef6763e79ea67b8b3a71a5 /modules/input/gtkimcontextmultipress.c | |
parent | 9f9c5ca49ada3e9345a48fd8d642883c0f7339fb (diff) | |
download | gtk+-24174e5528018c36868c4e4f834a8614b460bafb.tar.gz |
multipress: Only emit preedit signals if needed
When clearing the compose buffer, don't emit preedit-changed
unconditionally. This triggers a recursion which leads to
a crash.
https://bugzilla.gnome.org/show_bug.cgi?id=753644
Diffstat (limited to 'modules/input/gtkimcontextmultipress.c')
-rw-r--r-- | modules/input/gtkimcontextmultipress.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/input/gtkimcontextmultipress.c b/modules/input/gtkimcontextmultipress.c index 9cfe0289af..b92570bdbd 100644 --- a/modules/input/gtkimcontextmultipress.c +++ b/modules/input/gtkimcontextmultipress.c @@ -170,11 +170,14 @@ clear_compose_buffer (GtkImContextMultipress *multipress_context) multipress_context->key_last_entered = 0; multipress_context->compose_count = 0; - multipress_context->tentative_match = NULL; cancel_automatic_timeout_commit (multipress_context); - g_signal_emit_by_name (multipress_context, "preedit-changed"); - g_signal_emit_by_name (multipress_context, "preedit-end"); + if (multipress_context->tentative_match) + { + multipress_context->tentative_match = NULL; + g_signal_emit_by_name (multipress_context, "preedit-changed"); + g_signal_emit_by_name (multipress_context, "preedit-end"); + } } /* Finish composing, provide the character, and clear our compose buffer. |