[balsa/gtk4: 271/311] message-window: Connect to the "unrealize" signal




commit 030862fd8c184cec7369290e2ba81f65f5e2379f
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Thu Nov 19 18:21:34 2020 -0500

    message-window: Connect to the "unrealize" signal
    
    GtkWindow no longer emits the "destroy" signal. Also, adding a weak-ref
    does not work, as the weak-ref-notify function is never called.

 src/message-window.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/message-window.c b/src/message-window.c
index f8096e7c1..89d26afad 100644
--- a/src/message-window.c
+++ b/src/message-window.c
@@ -335,7 +335,7 @@ mw_set_message(MessageWindow * mw, LibBalsaMessage * message)
     if (mw->idle_handler_id && !message) {
        g_source_remove(mw->idle_handler_id);
        mw->idle_handler_id = 0;
-    } 
+    }
 
     if (mw->message) {
         g_object_set_data(G_OBJECT(mw->message), BALSA_MESSAGE_WINDOW_KEY, NULL);
@@ -352,9 +352,9 @@ mw_set_message(MessageWindow * mw, LibBalsaMessage * message)
     }
 }
 
-/* Handler for the "destroy" signal for mw->window. */
+/* Handler for the "unrealize" signal for mw->window. */
 static void
-destroy_message_window(GtkWidget * widget, MessageWindow * mw)
+mw_window_unrealized(GtkWidget * widget, MessageWindow * mw)
 {
     if (mw->bindex) {           /* BalsaIndex still exists */
         g_object_weak_unref(G_OBJECT(mw->bindex), mw_bindex_closed_cb, mw);
@@ -900,8 +900,7 @@ message_window_new(LibBalsaMailbox * mailbox, guint msgno)
     mw->toolbar = balsa_toolbar_new(model, G_ACTION_MAP(window));
     gtk_box_append(GTK_BOX(vbox), mw->toolbar);
 
-    g_signal_connect(window, "destroy",
-                    G_CALLBACK(destroy_message_window), mw);
+    g_signal_connect(window, "unrealize", G_CALLBACK(mw_window_unrealized), mw);
 
     mw->bindex = balsa_find_index_by_mailbox(mailbox);
     g_object_weak_ref(G_OBJECT(mw->bindex), mw_bindex_closed_cb, mw);


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