From 5ac80d2f3c2a7720f3095a8e4145b1780494dfd2 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Fri, 29 Aug 2014 21:15:29 +0200 Subject: [PATCH] Fix castling rights on using -lgf The dummy InitPosition to force loading pieces was taking place after InitBackend2(), while the latter could have already loaded a game from an -lgf argument (which would then be spoiled by the InitPosition). It has been moved to before InitBackend2() now. --- gtk/xboard.c | 5 +++-- xaw/xboard.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gtk/xboard.c b/gtk/xboard.c index e42f090..d6f47d7 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -1152,6 +1152,9 @@ main (int argc, char **argv) BoardToTop(); } + gameInfo.boardWidth = 0; // [HGM] pieces: kludge to ensure InitPosition() calls InitDrawingSizes() + InitPosition(TRUE); + InitBackEnd2(); if (errorExitStatus == -1) { @@ -1172,8 +1175,6 @@ main (int argc, char **argv) } } - gameInfo.boardWidth = 0; // [HGM] pieces: kludge to ensure InitPosition() calls InitDrawingSizes() - InitPosition(TRUE); UpdateLogos(TRUE); // XtSetKeyboardFocus(shellWidget, formWidget); #ifdef TODO_GTK diff --git a/xaw/xboard.c b/xaw/xboard.c index 8d0fb24..ac57033 100644 --- a/xaw/xboard.c +++ b/xaw/xboard.c @@ -1320,6 +1320,9 @@ main (int argc, char **argv) EngineOutputPopUp(); } + gameInfo.boardWidth = 0; // [HGM] pieces: kludge to ensure InitPosition() calls InitDrawingSizes() + InitPosition(TRUE); + InitBackEnd2(); if (errorExitStatus == -1) { @@ -1340,8 +1343,6 @@ main (int argc, char **argv) } } - gameInfo.boardWidth = 0; // [HGM] pieces: kludge to ensure InitPosition() calls InitDrawingSizes() - InitPosition(TRUE); UpdateLogos(TRUE); // XtSetKeyboardFocus(shellWidget, formWidget); XSetInputFocus(xDisplay, XtWindow(formWidget), RevertToPointerRoot, CurrentTime); -- 1.7.0.4