aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/text/e-entry.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/widgets/text/e-entry.c b/widgets/text/e-entry.c
index 132de14ee6..fca872d55c 100644
--- a/widgets/text/e-entry.c
+++ b/widgets/text/e-entry.c
@@ -122,6 +122,7 @@ struct _EEntryPrivate {
guint draw_borders : 1;
guint emulate_label_resize : 1;
guint have_set_transient : 1;
+ guint item_chosen : 1;
gint last_width;
};
@@ -561,13 +562,6 @@ e_entry_show_popup (EEntry *entry, gboolean visible)
}
static void
-e_entry_refresh_popup (EEntry *entry)
-{
- if (entry->priv->popup_is_visible)
- e_entry_show_popup (entry, TRUE);
-}
-
-static void
e_entry_start_completion (EEntry *entry)
{
if (entry->priv->completion == NULL)
@@ -576,6 +570,8 @@ e_entry_start_completion (EEntry *entry)
if (e_entry_is_empty (entry))
return;
+ entry->priv->item_chosen = FALSE;
+
e_completion_begin_search (entry->priv->completion,
e_entry_get_text (entry),
entry->priv->last_completion_pos = e_entry_get_position (entry),
@@ -622,19 +618,12 @@ nonempty_cb (ECompletionView *view, gpointer user_data)
}
static void
-added_cb (ECompletionView *view, gpointer user_data)
-{
- EEntry *entry = E_ENTRY (user_data);
- e_entry_refresh_popup (entry);
-}
-
-static void
full_cb (ECompletionView *view, gpointer user_data)
{
EEntry *entry = E_ENTRY (user_data);
gboolean show;
- show = GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (entry->canvas)) && view->choices->len > 0;
+ show = GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (entry->canvas)) && view->choices->len > 0 && !entry->priv->item_chosen;
e_entry_show_popup (entry, show);
}
@@ -691,6 +680,8 @@ activate_cb (ECompletionView *view, ECompletionMatch *match, gpointer user_data)
else
e_entry_set_text (entry, match->match_text);
+ entry->priv->item_chosen = TRUE;
+
e_entry_cancel_delayed_completion (entry);
}
@@ -803,11 +794,6 @@ e_entry_enable_completion_full (EEntry *entry, ECompletion *completion, gint del
G_CALLBACK (nonempty_cb),
entry);
- entry->priv->added_signal_id = g_signal_connect (entry->priv->completion_view,
- "added",
- G_CALLBACK (added_cb),
- entry);
-
entry->priv->full_signal_id = g_signal_connect (entry->priv->completion_view,
"full",
G_CALLBACK (full_cb),