]> granicus.if.org Git - nethack/commitdiff
additional X11 SAFERHANGUP changes
authorcohrs <cohrs>
Tue, 14 Oct 2003 07:55:36 +0000 (07:55 +0000)
committercohrs <cohrs>
Tue, 14 Oct 2003 07:55:36 +0000 (07:55 +0000)
While messing around with window closure events, I found that some such
events during startup were being ignored as a result a SAFERHANGUP changes.

win/X11/winX.c
win/X11/winmisc.c

index 0401f37704f4ee988b67548aec183c2451a3baec..743e42916d67772d285389ef0b3bae1c0d17cb18 100644 (file)
@@ -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 ----------------------------------------------------------------- */
index f364f8ed403d54a7d1a9aa7eade878587dd49502..29140e4470fea24d65c4b9f9b4fccbd151d77ed0 100644 (file)
@@ -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);