[balsa/gtk4] message-window: Connect to "close-request" signal
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/gtk4] message-window: Connect to "close-request" signal
- Date: Thu, 19 Nov 2020 22:32:24 +0000 (UTC)
commit 7addd4a7689b8f735e4662afe3b6f926c56a705c
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Thu Nov 19 17:27:56 2020 -0500
message-window: Connect to "close-request" signal
GtkWindow does not emit the "destroy" signal when it is being destroyed.
src/message-window.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/message-window.c b/src/message-window.c
index f8096e7c1..2213ac583 100644
--- a/src/message-window.c
+++ b/src/message-window.c
@@ -352,9 +352,9 @@ mw_set_message(MessageWindow * mw, LibBalsaMessage * message)
}
}
-/* Handler for the "destroy" signal for mw->window. */
-static void
-destroy_message_window(GtkWidget * widget, MessageWindow * mw)
+/* Handler for the "close-request" signal for mw->window. */
+static gboolean
+mw_close_request(GtkWidget * widget, MessageWindow * mw)
{
if (mw->bindex) { /* BalsaIndex still exists */
g_object_weak_unref(G_OBJECT(mw->bindex), mw_bindex_closed_cb, mw);
@@ -380,6 +380,8 @@ destroy_message_window(GtkWidget * widget, MessageWindow * mw)
mw_set_message(mw, NULL);
g_free(mw);
+
+ return FALSE;
}
/* Handler for the mailbox's "message-expunged" signal */
@@ -900,8 +902,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, "close-request", G_CALLBACK(mw_close_request), 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]