From 2732b225cfe95593069878951f7ae32d23b9be0f Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sun, 13 Mar 2016 09:21:43 +0100 Subject: [PATCH] Fix popdown of Error/Help dialog through window-close button Closing an Error popup that was a daughter of another dialog (as Help dialogs would often be) through the window-close button instead of 'OK' would permanently block popdown of the parent dialog, because the info that the Error dialog was still up would not have been reset by the Error dialog's OK function. GenericPopDown now calls the OK function of such a dialog (actually FatalDlg) even on a REJECT response. --- dialogs.c | 2 +- dialogs.h | 2 ++ gtk/xoptions.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dialogs.c b/dialogs.c index f391997..759830b 100644 --- a/dialogs.c +++ b/dialogs.c @@ -2296,7 +2296,7 @@ ErrorPopDown () if (errorExitStatus != -1) ExitEvent(errorExitStatus); } -static int +int ErrorOK (int n) { dialogError = errorUp = False; diff --git a/dialogs.h b/dialogs.h index 15c2725..fb9ea3d 100644 --- a/dialogs.h +++ b/dialogs.h @@ -201,6 +201,8 @@ void RefreshColor P((int source, int n)); void SendString P((char *p)); void DisplayHelp P((char *name)); void WidgetEcho P((Option *opt, int n)); +int ErrorOK P((int n)); + // in ngamelist.c int GameListClicks P((int direction)); diff --git a/gtk/xoptions.c b/gtk/xoptions.c index 9e27c7e..e9e7a0a 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -861,7 +861,7 @@ gboolean GenericPopDown(w, resptype, gdata) /* cancel pressed */ { if(dlg == BoardWindow) ExitEvent(0); - PopDown(dlg); + if(dlg == FatalDlg) ErrorOK(1); else PopDown(dlg); } shells[dlg] = sh; // restore return TRUE; -- 1.7.0.4