X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard.c;h=1e009fa8c4c96844d763ff405b77fb71db07e1ad;hb=7872dd67ef41b2812819bf7682cc96a81ca75f70;hp=8f1cff1edfc7fc9597e4532c37893f9909bb4029;hpb=7ce7c91789520647171c38aaa59b6bb28be98b28;p=xboard.git diff --git a/xboard.c b/xboard.c index 8f1cff1..1e009fa 100644 --- a/xboard.c +++ b/xboard.c @@ -1907,7 +1907,15 @@ main(argc, argv) XtGetApplicationResources(shellWidget, (XtPointer) &appData, clientResources, XtNumber(clientResources), NULL, 0); - + + if (appData.debugMode) { + if ((debugFP = fopen("xboard.debug", "w")) == NULL) { + printf(_("Failed to open file xboard.debug \n")); + exit(errno); + } + setbuf(debugFP, NULL); + } + #if !HIGHDRAG /* This feature does not work; animation needs a rewrite */ appData.highlightDragging = FALSE; @@ -2553,6 +2561,8 @@ XBoard square size (hint): %d\n\ } XtAppMainLoop(appContext); + if (appData.debugMode) fclose(debugFP); + return 0; } @@ -5029,6 +5039,8 @@ void AnalysisPopDown() XtPopdown(analysisShell); XSync(xDisplay, False); analysisUp = False; + /* icsEngineAnalyze */ + if (appData.icsEngineAnalyze) ExitAnalyzeMode(); } @@ -5878,7 +5890,6 @@ void AnalyzeModeProc(w, event, prms, nprms) if (appData.icsEngineAnalyze) { if (appData.debugMode) fprintf(debugFP, _("Found unexpected active ICS engine analyze \n")); - appData.icsEngineAnalyze = FALSE; ExitAnalyzeMode(); ModeHighlight(); return; @@ -5887,7 +5898,6 @@ void AnalyzeModeProc(w, event, prms, nprms) } else { /* if enable, use want disable icsEngineAnalyze */ if (appData.icsEngineAnalyze) { - appData.icsEngineAnalyze = FALSE; ExitAnalyzeMode(); ModeHighlight(); return;