[gtk+/gtk-3-16] multipress: Only emit preedit signals if needed
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-16] multipress: Only emit preedit signals if needed
- Date: Fri, 18 Sep 2015 01:11:32 +0000 (UTC)
commit cf2a41cb5247fa7bc8cbfbf28a673a40a39ea3d2
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Aug 18 15:42:56 2015 -0400
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
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 9cfe028..b92570b 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.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]