Blob Blame History Raw
diff -up evolution-3.12.11/e-util/e-spell-entry.c.spell-entry-preedit evolution-3.12.11/e-util/e-spell-entry.c
--- evolution-3.12.11/e-util/e-spell-entry.c.spell-entry-preedit	2014-11-11 13:47:54.000000000 +0100
+++ evolution-3.12.11/e-util/e-spell-entry.c	2015-08-11 12:26:55.186412360 +0200
@@ -44,6 +44,7 @@ struct _ESpellEntryPrivate {
 	gchar **words;
 	gint *word_starts;
 	gint *word_ends;
+	gboolean im_in_preedit;
 };
 
 enum {
@@ -721,6 +722,16 @@ spell_entry_find_position (ESpellEntry *
 }
 
 static void
+spell_entry_preedit_changed_cb (ESpellEntry *spell_entry,
+				const gchar *preedit_text,
+				gpointer user_data)
+{
+	g_return_if_fail (E_IS_SPELL_ENTRY (spell_entry));
+
+	spell_entry->priv->im_in_preedit = preedit_text && *preedit_text;
+}
+
+static void
 spell_entry_set_property (GObject *object,
                           guint property_id,
                           const GValue *value,
@@ -797,6 +808,8 @@ spell_entry_constructed (GObject *object
 	/* Chain up to parent's constructed() method. */
 	G_OBJECT_CLASS (e_spell_entry_parent_class)->constructed (object);
 
+	g_signal_connect (object, "preedit-changed", G_CALLBACK (spell_entry_preedit_changed_cb), NULL);
+
 	e_extensible_load_extensions (E_EXTENSIBLE (object));
 }
 
@@ -805,11 +818,14 @@ spell_entry_draw (GtkWidget *widget,
                   cairo_t *cr)
 {
 	ESpellEntry *spell_entry = E_SPELL_ENTRY (widget);
-	GtkEntry *entry = GTK_ENTRY (widget);
-	PangoLayout *layout;
 
-	layout = gtk_entry_get_layout (entry);
-	pango_layout_set_attributes (layout, spell_entry->priv->attr_list);
+	if (!spell_entry->priv->im_in_preedit) {
+		GtkEntry *entry = GTK_ENTRY (widget);
+		PangoLayout *layout;
+
+		layout = gtk_entry_get_layout (entry);
+		pango_layout_set_attributes (layout, spell_entry->priv->attr_list);
+	}
 
 	/* Chain up to parent's draw() method. */
 	return GTK_WIDGET_CLASS (e_spell_entry_parent_class)->
@@ -868,6 +884,7 @@ e_spell_entry_init (ESpellEntry *spell_e
 	spell_entry->priv->attr_list = pango_attr_list_new ();
 	spell_entry->priv->checkers = NULL;
 	spell_entry->priv->checking_enabled = TRUE;
+	spell_entry->priv->im_in_preedit = FALSE;
 
 	g_signal_connect (
 		spell_entry, "popup-menu",