summary refs log tree commit diff stats
path: root/src/fe-gtk/sexy-spell-entry.c
diff options
context:
space:
mode:
authorArnavion <arnavion@gmail.com>2015-04-24 19:20:48 -0700
committerArnavion <arnavion@gmail.com>2015-04-24 19:20:48 -0700
commit0b40146b85e9017fdfe6d98bf33f622defa186db (patch)
tree8a4c2c32c3b9dd1ac7662119c244530e9573257c /src/fe-gtk/sexy-spell-entry.c
parent9b2c5605195dbbf246660f238bec5a91019ec617 (diff)
Disable pango attributes on sexy entry while it contains preedit text.
Fixes #1360
Diffstat (limited to 'src/fe-gtk/sexy-spell-entry.c')
-rw-r--r--src/fe-gtk/sexy-spell-entry.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/fe-gtk/sexy-spell-entry.c b/src/fe-gtk/sexy-spell-entry.c
index 0617d947..61cdff3e 100644
--- a/src/fe-gtk/sexy-spell-entry.c
+++ b/src/fe-gtk/sexy-spell-entry.c
@@ -141,6 +141,8 @@ enum
 };
 static guint signals[LAST_SIGNAL] = {0};
 
+static PangoAttrList *empty_attrs_list = NULL;
+
 static gboolean
 spell_accumulator(GSignalInvocationHint *hint, GValue *return_accu, const GValue *handler_return, gpointer data)
 {
@@ -248,6 +250,11 @@ sexy_spell_entry_class_init(SexySpellEntryClass *klass)
 					   _hexchat_marshal_BOOLEAN__STRING,
 					   G_TYPE_BOOLEAN,
 					   1, G_TYPE_STRING);
+
+	if (empty_attrs_list == NULL)
+	{
+		empty_attrs_list = pango_attr_list_new ();
+	}
 }
 
 static void
@@ -1080,7 +1087,14 @@ sexy_spell_entry_expose(GtkWidget *widget, GdkEventExpose *event)
 
 	
 	layout = gtk_entry_get_layout(gtk_entry);
-	pango_layout_set_attributes(layout, entry->priv->attr_list);
+	if (gtk_entry->preedit_length == 0)
+	{
+		pango_layout_set_attributes(layout, entry->priv->attr_list);
+	}
+	else
+	{
+		pango_layout_set_attributes(layout, empty_attrs_list);
+	}
 
 	return GTK_WIDGET_CLASS(parent_class)->expose_event (widget, event);
 }