From: cohrs <cohrs>
Date: Tue, 14 Oct 2003 07:55:36 +0000 (+0000)
Subject: additional X11 SAFERHANGUP changes
X-Git-Tag: MOVE2GIT~1699
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9dc6ad96da07f05217eaf4e8b9f901b7284c321f;p=nethack

additional X11 SAFERHANGUP changes
While messing around with window closure events, I found that some such
events during startup were being ignored as a result a SAFERHANGUP changes.
---

diff --git a/win/X11/winX.c b/win/X11/winX.c
index 0401f3770..743e42916 100644
--- a/win/X11/winX.c
+++ b/win/X11/winX.c
@@ -1187,6 +1187,7 @@ X11_hangup(w, event, params, num_params)
     Cardinal *num_params;
 {
     hangup(1);		/* 1 is commonly SIGHUP, but ignored anyway */
+    exit_x_event = TRUE;
 }
 
 /* askname ----------------------------------------------------------------- */
diff --git a/win/X11/winmisc.c b/win/X11/winmisc.c
index f364f8ed4..29140e447 100644
--- a/win/X11/winmisc.c
+++ b/win/X11/winmisc.c
@@ -320,7 +320,7 @@ X11_player_selection()
 	XtDestroyWidget(popup);
 	free((genericptr_t)choices), choices = 0;
 
-	if (ps_selected == PS_QUIT) {
+	if (ps_selected == PS_QUIT || program_state.done_hup) {
 	    clearlocks();
 	    X11_exit_nhwindows((char *)0);
 	    terminate(0);
@@ -385,7 +385,7 @@ X11_player_selection()
 	    XtDestroyWidget(popup);
 	    free((genericptr_t)choices), choices = 0;
 
-	    if (ps_selected == PS_QUIT) {
+	    if (ps_selected == PS_QUIT || program_state.done_hup) {
 		clearlocks();
 		X11_exit_nhwindows((char *)0);
 		terminate(0);
@@ -450,7 +450,7 @@ X11_player_selection()
 	    XtDestroyWidget(popup);
 	    free((genericptr_t)choices), choices = 0;
 
-	    if (ps_selected == PS_QUIT) {
+	    if (ps_selected == PS_QUIT || program_state.done_hup) {
 		clearlocks();
 		X11_exit_nhwindows((char *)0);
 		terminate(0);
@@ -514,7 +514,7 @@ X11_player_selection()
 	    XtDestroyWidget(popup);
 	    free((genericptr_t)choices), choices = 0;
 
-	    if (ps_selected == PS_QUIT) {
+	    if (ps_selected == PS_QUIT || program_state.done_hup) {
 		clearlocks();
 		X11_exit_nhwindows((char *)0);
 		terminate(0);