aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--lib/widgets/ephy-search-entry.c31
2 files changed, 20 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 5d9635b3c..aa7377ec9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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
+
2003-07-25 Xan Lopez <xan@masilla.org>
* src/pdm-dialog.c: (setup_passwords_treeview),
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);
}