From: H.G.Muller Date: Sat, 5 Mar 2016 21:59:14 +0000 (+0100) Subject: Fix parent dialog of Error Popup X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=0fbcff4594d6dd3a60063a8734b2d41f17cb7bd2;p=xboard.git Fix parent dialog of Error Popup If the parent dialog of the Error Popup is wrong, the OK button in it will not manage to pop it down. Migrating the Tourney Options to their own DialogClass had changed testing for a parent other than the board window from TransientDlg to MasterDlg, but Toerney Options was not the only such dialog throwing up errors. (E.g. New Variant coulddo it too.) So we now test if MasterDlg or TransientDlg is up, and use those as parent if they are. --- diff --git a/dialogs.c b/dialogs.c index 7db75db..890ed13 100644 --- a/dialogs.c +++ b/dialogs.c @@ -2289,8 +2289,10 @@ ErrorPopUp (char *title, char *label, int modal) { errorUp = True; errorOptions[1].name = label; - if(dialogError = shellUp[MasterDlg]) - GenericPopUp(errorOptions+1, title, FatalDlg, MasterDlg, MODAL, 0); // pop up as daughter of the transient dialog + if(dialogError = shellUp[TransientDlg]) + GenericPopUp(errorOptions+1, title, FatalDlg, TransientDlg, MODAL, 0); // pop up as daughter of the transient dialog + else if(dialogError = shellUp[MasterDlg]) + GenericPopUp(errorOptions+1, title, FatalDlg, MasterDlg, MODAL, 0); // pop up as daughter of the master dialog else GenericPopUp(errorOptions+modal, title, modal ? FatalDlg: ErrorDlg, BoardWindow, modal, 0); // kludge: option start address indicates modality }