diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-06-05 03:28:47 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-06-05 03:28:47 +0000 |
commit | cd889b96814cd7c88f254ac91b92d807915e8d5d (patch) | |
tree | dbf665fdccdbd10be680218633adbdea856364b6 /src/addr_compl.c | |
parent | 8adabeeba386bf746a29ab9945654301e7d870c3 (diff) |
fixed infinite loop on completion start with GTK+ 2.18+.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2564 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/addr_compl.c')
-rw-r--r-- | src/addr_compl.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/addr_compl.c b/src/addr_compl.c index 39433fb2..9735f273 100644 --- a/src/addr_compl.c +++ b/src/addr_compl.c @@ -296,16 +296,25 @@ gchar *get_address_from_edit(GtkEntry *entry, gint *start_pos) void replace_address_in_edit(GtkEntry *entry, const gchar *newtext, gint start_pos) { + gchar *origtext; + if (!newtext) return; + g_print("replace_address_in_edit: %s\n", newtext); + + origtext = gtk_editable_get_chars(GTK_EDITABLE(entry), start_pos, -1); + if (!strcmp(origtext, newtext)) { + g_free(origtext); + return; + } + g_free(origtext); + g_signal_handlers_block_by_func (entry, address_completion_entry_changed, NULL); - gtk_editable_delete_text(GTK_EDITABLE(entry), start_pos, -1); gtk_editable_insert_text(GTK_EDITABLE(entry), newtext, strlen(newtext), &start_pos); gtk_editable_set_position(GTK_EDITABLE(entry), -1); - g_signal_handlers_unblock_by_func (entry, address_completion_entry_changed, NULL); } |