aboutsummaryrefslogtreecommitdiffstats
path: root/lib/widgets
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-07-26 01:03:50 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-07-26 01:03:50 +0800
commit3e53d46bb756fad2fc25c70f1923af01f9b0574e (patch)
tree7f11b7d4f64115a53b55523854e2700fa6a36006 /lib/widgets
parentda34a92dfce1a75705bf54646db0e936934ea3e5 (diff)
downloadgsoc2013-epiphany-3e53d46bb756fad2fc25c70f1923af01f9b0574e.tar
gsoc2013-epiphany-3e53d46bb756fad2fc25c70f1923af01f9b0574e.tar.gz
gsoc2013-epiphany-3e53d46bb756fad2fc25c70f1923af01f9b0574e.tar.bz2
gsoc2013-epiphany-3e53d46bb756fad2fc25c70f1923af01f9b0574e.tar.lz
gsoc2013-epiphany-3e53d46bb756fad2fc25c70f1923af01f9b0574e.tar.xz
gsoc2013-epiphany-3e53d46bb756fad2fc25c70f1923af01f9b0574e.tar.zst
gsoc2013-epiphany-3e53d46bb756fad2fc25c70f1923af01f9b0574e.zip
Make sure to remove the timeout on widget destruction
2003-07-25 Marco Pesenti Gritti <marco@it.gnome.org> * lib/widgets/ephy-search-entry.c: (ephy_search_entry_destroy_cb), (ephy_search_entry_init): Make sure to remove the timeout on widget destruction
Diffstat (limited to 'lib/widgets')
-rw-r--r--lib/widgets/ephy-search-entry.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/lib/widgets/ephy-search-entry.c b/lib/widgets/ephy-search-entry.c
index 9837da909..e1b106594 100644
--- a/lib/widgets/ephy-search-entry.c
+++ b/lib/widgets/ephy-search-entry.c
@@ -125,34 +125,29 @@ ephy_search_entry_changed_cb (GtkEditable *editable,
entry->priv->timeout = g_timeout_add (300, (GSourceFunc) ephy_search_entry_timeout_cb, entry);
}
-static gboolean
-ephy_search_entry_focus_out_event_cb (GtkWidget *widget,
- GdkEventFocus *event,
- EphySearchEntry *entry)
+static void
+ephy_search_entry_destroy_cb (GtkEditable *editable,
+ EphySearchEntry *entry)
{
- if (entry->priv->timeout == 0)
- return FALSE;
-
- g_source_remove (entry->priv->timeout);
- entry->priv->timeout = 0;
-
- g_signal_emit (G_OBJECT (entry), ephy_search_entry_signals[SEARCH], 0,
- gtk_entry_get_text (GTK_ENTRY (entry)));
-
- return FALSE;
+ if (entry->priv->timeout)
+ {
+ g_source_remove (entry->priv->timeout);
+ entry->priv->timeout = 0;
+ }
}
+
static void
ephy_search_entry_init (EphySearchEntry *entry)
{
entry->priv = g_new0 (EphySearchEntryPrivate, 1);
g_signal_connect (G_OBJECT (entry),
- "changed",
- G_CALLBACK (ephy_search_entry_changed_cb),
+ "destroy",
+ G_CALLBACK (ephy_search_entry_destroy_cb),
entry);
g_signal_connect (G_OBJECT (entry),
- "focus_out_event",
- G_CALLBACK (ephy_search_entry_focus_out_event_cb),
+ "changed",
+ G_CALLBACK (ephy_search_entry_changed_cb),
entry);
}