Commit 536fc22d authored by Bastien Nocera's avatar Bastien Nocera

GtkSearchEntry: Don't wait for timeout when emptying

When the text entry gets cleared, emit the "changed" signal
straight away. This avoids a lag when dismissing a search.
parent 1bfbfbc5
......@@ -124,6 +124,7 @@ search_entry_changed_cb (GtkSearchEntry *entry,
GtkSearchEntryPrivate *priv = GET_PRIV (entry);
const char *str, *icon_name;
gboolean active;
gboolean cleared = FALSE;
/* Update the icons first */
str = gtk_entry_get_text (GTK_ENTRY (entry));
......@@ -132,6 +133,7 @@ search_entry_changed_cb (GtkSearchEntry *entry,
icon_name = NULL;
active = FALSE;
cleared = TRUE;
......@@ -153,6 +155,11 @@ search_entry_changed_cb (GtkSearchEntry *entry,
if (priv->in_timeout)
/* Don't emit the signal in a timeout if we've cleared
* the entry, we don't want a delay */
if (cleared)
/* Queue up the timeout */
reset_timeout (entry);
g_signal_stop_emission_by_name (entry, "changed");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment