changeset 14737:87fe294744aa

[gaim-migrate @ 17493] Patch from Richard Nelson (wabz). This will allow the WM to do stuff when a window is closed. Also, ignore SIGPIPE, although this doesn't seem to help. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 17 Oct 2006 04:34:55 +0000
parents d1eb55b1b28d
children e1cfdb131c62
files console/libgnt/gntmain.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/console/libgnt/gntmain.c	Tue Oct 17 04:07:19 2006 +0000
+++ b/console/libgnt/gntmain.c	Tue Oct 17 04:34:55 2006 +0000
@@ -268,7 +268,8 @@
 			GNT_WIDGET_UNSET_FLAGS(w, GNT_WIDGET_URGENT);
 			if (wm.window_update) {
 				GntNode *node = g_hash_table_lookup(nodes, w);
-				wm.window_update(node->panel, w);
+				if (node)
+					wm.window_update(node->panel, w);
 			}
 		} else if (GNT_WIDGET_IS_FLAG_SET(w, GNT_WIDGET_URGENT)) {
 			/* This is a window with the URGENT hint set */
@@ -1158,6 +1159,7 @@
 	signal(SIGWINCH, sighandler);
 #endif
 	signal(SIGCHLD, sighandler);
+	signal(SIGPIPE, SIG_IGN);
 
 	g_type_init();
 
@@ -1225,6 +1227,9 @@
 	if (node == NULL)	/* Yay! Nothing to do. */
 		return;
 
+	if (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_DESTROYING) && wm.close_window)
+		wm.close_window(widget);
+
 	g_hash_table_remove(nodes, widget);
 
 	if (window_list)