[balsa/gtk3] Close compose windows on exit



commit e201317794541b44cc41338efb3c1a645693c6b6
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Mon Feb 2 17:38:36 2015 -0500

    Close compose windows on exit
    
        * src/sendmsg-window.c (balsa_sendmsg_destroy_handler),
        (sendmsg_window_new): weak-ref the main-window and close any
        compose window that is still open.

 ChangeLog            |    8 ++++++++
 src/sendmsg-window.c |    6 ++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 202115e..1570b09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2015-02-02  Peter Bloomfield  <pbloomfield bellsouth net>
 
+       Close compose windows on exit
+
+       * src/sendmsg-window.c (balsa_sendmsg_destroy_handler),
+       (sendmsg_window_new): weak-ref the main-window and close any
+       compose window that is still open.
+
+2015-02-02  Peter Bloomfield  <pbloomfield bellsouth net>
+
        Prune some dead code
 
        * src/balsa-message.c (balsa_message_init), (balsa_message_new):
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index 8ea60de..b017920 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -607,6 +607,8 @@ balsa_sendmsg_destroy_handler(BalsaSendmsg * bsmsg)
                                     bsmsg->delete_sig_id);
         g_signal_handler_disconnect(G_OBJECT(balsa_app.main_window),
                                     bsmsg->identities_changed_id);
+        g_object_weak_unref(G_OBJECT(balsa_app.main_window),
+                            (GWeakNotify) gtk_widget_destroy, bsmsg->window);
     }
     if(balsa_app.debug) g_message("balsa_sendmsg_destroy()_handler: Start.");
 
@@ -6745,6 +6747,10 @@ sendmsg_window_new()
                     G_CALLBACK(destroy_event_cb), bsmsg);
     g_signal_connect(G_OBJECT(window), "size_allocate",
                     G_CALLBACK(sw_size_alloc_cb), bsmsg);
+    /* If any compose windows are open when Balsa is closed, we want
+     * them also to be closed. */
+    g_object_weak_ref(G_OBJECT(balsa_app.main_window),
+                      (GWeakNotify) gtk_widget_destroy, window);
 
     model = sendmsg_window_get_toolbar_model();
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]