aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/mail-callbacks.c19
2 files changed, 25 insertions, 0 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index cc564dc7f9..479d5c2580 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,9 @@
+2001-10-11 Jon Trowbridge <trow@ximian.com>
+
+ * mail-callbacks.c (addrbook_sender): Listen for "destroy" events
+ from the control, so that we don't leave stray windows laying
+ around. (Bug #9101)
+
2001-10-11 <NotZed@Ximian.com>
* local-config.glade: Added a checkbox for body indexing.
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index d4430078b9..df292f480c 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -1288,6 +1288,22 @@ find_socket (GtkContainer *container)
return NULL;
}
+static void
+popup_listener_cb (BonoboListener *listener,
+ char *event_name,
+ CORBA_any *any,
+ CORBA_Environment *ev,
+ gpointer user_data)
+{
+ char *type = bonobo_event_subtype (event_name);
+
+ if (!strcmp (type, "Destroy")) {
+ gtk_widget_destroy (GTK_WIDGET (user_data));
+ }
+
+ g_free (type);
+}
+
void
addrbook_sender (GtkWidget *widget, gpointer user_data)
{
@@ -1322,6 +1338,9 @@ addrbook_sender (GtkWidget *widget, gpointer user_data)
"email", addr_str,
NULL);
+ bonobo_event_source_client_add_listener (bonobo_widget_get_objref (BONOBO_WIDGET (control)),
+ popup_listener_cb, NULL, NULL, win);
+
socket = find_socket (GTK_CONTAINER (control));
gtk_signal_connect_object (GTK_OBJECT (socket),
"destroy",