Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserverui/ChangeLog,v
retrieving revision 1.89
diff -u -p -r1.89 ChangeLog
--- ChangeLog	26 Apr 2006 08:21:21 -0000	1.89
+++ ChangeLog	20 May 2006 11:21:28 -0000
@@ -1,3 +1,16 @@
+2006-05-20  Hiroyuki Ikezoe  <poincare@ikezoe.net>
+
+	** Fixes for bug 322239
+	* e-name-selector-entry.h: is_completing: New value.
+	* e-name-selector-entry.c: (type_ahead_complete):
+	Set is_completing to TRUE if address completion has done.
+	(clear_completion_model): Set is_completing to FALSE.
+	(entry_activate): Set is_completing to FALSE.
+	(user_focus_init): Call entry_activate if only focus_in and
+	is_compliting.
+	(e_name_selector_entry_init): Set is_completing to TRUE.
+	It's initial state.
+
 2006-04-26  Srinivasa Ragavan  <sragavan@novell.com>
 
 	* e-passwords.c: (ep_clear_passwords), (ep_forget_passwords),
Index: e-name-selector-entry.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserverui/e-name-selector-entry.c,v
retrieving revision 1.30
diff -u -p -r1.30 e-name-selector-entry.c
--- e-name-selector-entry.c	5 Mar 2006 10:17:07 -0000	1.30
+++ e-name-selector-entry.c	20 May 2006 11:21:29 -0000
@@ -767,6 +767,7 @@ type_ahead_complete (ENameSelectorEntry 
 		gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), textrep, -1, &pos);
 		gtk_editable_select_region (GTK_EDITABLE (name_selector_entry), range_end,
 					    range_start + textrep_len);
+		name_selector_entry->is_completing = TRUE;
 	}
 
 	if (contact && destination) {
@@ -794,6 +795,7 @@ clear_completion_model (ENameSelectorEnt
 		return;
 
 	e_contact_store_set_query (name_selector_entry->contact_store, NULL);
+	name_selector_entry->is_completing = FALSE;
 }
 
 static void
@@ -1288,13 +1290,16 @@ entry_activate (ENameSelectorEntry *name
 	text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry));
 	get_range_at_position (text, cursor_pos, &range_start, &range_end);
 	gtk_editable_set_position (GTK_EDITABLE (name_selector_entry), range_end);
+	
+	name_selector_entry->is_completing = FALSE;
 }
 
 static gboolean
 user_focus_out (ENameSelectorEntry *name_selector_entry, GdkEventFocus *event_focus)
 {
-	if (!event_focus->in)
+	if (!event_focus->in && name_selector_entry->is_completing) {
 		entry_activate (name_selector_entry);
+	}
 
 	clear_completion_model (name_selector_entry);
 
@@ -2079,6 +2084,7 @@ e_name_selector_entry_init (ENameSelecto
 
   name_selector_entry->destination_store = e_destination_store_new ();
   setup_destination_store (name_selector_entry);
+  name_selector_entry->is_completing = FALSE;
 }
 
 /**
Index: e-name-selector-entry.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserverui/e-name-selector-entry.h,v
retrieving revision 1.7
diff -u -p -r1.7 e-name-selector-entry.h
--- e-name-selector-entry.h	31 Aug 2005 04:26:10 -0000	1.7
+++ e-name-selector-entry.h	20 May 2006 11:21:29 -0000
@@ -60,6 +60,8 @@ struct ENameSelectorEntry {
 
 	guint                type_ahead_complete_cb_id;
 	guint                update_completions_cb_id;
+	
+	gboolean             is_completing;
 
 	EDestination        *popup_destination;
 
