From 87ff791dcbceed6c08d8490f802c0e7456d41508 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 3 Mar 2006 14:16:45 +0000 Subject: [PATCH] Avoid emitting superfluous preedit_changed signals. Thanks to Matthias. 2006-03-03 Tor Lillqvist * gtk/gtkimcontextsimple.c (gtk_im_context_simple_commit_char) (gtk_im_context_simple_reset): Avoid emitting superfluous preedit_changed signals. Thanks to Matthias. (#319407) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ gtk/gtkimcontextsimple.c | 19 ++++++++++++------- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index bac6b6b836..c5adae625e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-03-03 Tor Lillqvist + + * gtk/gtkimcontextsimple.c (gtk_im_context_simple_commit_char) + (gtk_im_context_simple_reset): Avoid emitting superfluous + preedit_changed signals. Thanks to Matthias. (#319407) + 2006-03-03 Michael Natterer Applied modified patch from maemo-gtk which makes separators more diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index bac6b6b836..c5adae625e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2006-03-03 Tor Lillqvist + + * gtk/gtkimcontextsimple.c (gtk_im_context_simple_commit_char) + (gtk_im_context_simple_reset): Avoid emitting superfluous + preedit_changed signals. Thanks to Matthias. (#319407) + 2006-03-03 Michael Natterer Applied modified patch from maemo-gtk which makes separators more diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c index 2433af793d..2d07ac2176 100644 --- a/gtk/gtkimcontextsimple.c +++ b/gtk/gtkimcontextsimple.c @@ -1032,10 +1032,13 @@ gtk_im_context_simple_commit_char (GtkIMContext *context, len = g_unichar_to_utf8 (ch, buf); buf[len] = '\0'; + if (context_simple->tentative_match || context_simple->in_hex_sequence) + { + context_simple->tentative_match = 0; + context_simple->tentative_match_len = 0; + g_signal_emit_by_name (context_simple, "preedit_changed"); + } context_simple->in_hex_sequence = FALSE; - context_simple->tentative_match = 0; - context_simple->tentative_match_len = 0; - g_signal_emit_by_name (context_simple, "preedit_changed"); g_signal_emit_by_name (context, "commit", &buf); } @@ -1519,11 +1522,13 @@ gtk_im_context_simple_reset (GtkIMContext *context) context_simple->compose_buffer[0] = 0; + if (context_simple->tentative_match || context_simple->in_hex_sequence) + { + context_simple->tentative_match = 0; + context_simple->tentative_match_len = 0; + g_signal_emit_by_name (context_simple, "preedit_changed"); + } context_simple->in_hex_sequence = FALSE; - context_simple->tentative_match = 0; - context_simple->tentative_match_len = 0; - - g_signal_emit_by_name (context_simple, "preedit_changed"); } static void