X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=677e21cfb47bcb97df4eb98217e59cf5d5237f56;hb=6e81557cc7a3d288c2b0860675b83d2c50d672e9;hp=1165932f36046d9dbe1aa369d1059b455510d358;hpb=dff5c053266d7b78bbadc95d7bf1f84ca97bf0c6;p=xboard.git diff --git a/backend.c b/backend.c index 1165932..677e21c 100644 --- a/backend.c +++ b/backend.c @@ -6541,7 +6541,7 @@ void LeftClick(ClickType clickType, int xPix, int yPix) if (appData.highlightDragging) { SetHighlights(fromX, fromY, -1, -1); } - } + } else fromX = fromY = -1; return; } } @@ -12084,6 +12084,7 @@ TwoMachinesEvent P((void)) char buf[MSG_SIZ]; ChessProgramState *onmove; char *bookHit = NULL; + static int stalling = 0; if (appData.noChessProgram) return; @@ -12120,13 +12121,23 @@ TwoMachinesEvent P((void)) ResurrectChessProgram(); /* in case first program isn't running */ if(WaitForSecond(TwoMachinesEventIfReady)) return; - DisplayMessage("", ""); - InitChessProgram(&second, FALSE); - SendToProgram("force\n", &second); if(first.lastPing != first.lastPong) { // [HGM] wait till we are sure first engine has set up position + DisplayMessage("", _("Waiting for first chess program")); ScheduleDelayedEvent(TwoMachinesEvent, 10); return; } + if(!stalling) { + InitChessProgram(&second, FALSE); + SendToProgram("force\n", &second); + } + if(second.lastPing != second.lastPong) { // [HGM] second engine might have to reallocate hash + if(!stalling) DisplayMessage("", _("Waiting for second chess program")); + stalling = 1; + ScheduleDelayedEvent(TwoMachinesEvent, 10); + return; + } + stalling = 0; + DisplayMessage("", ""); if (startedFromSetupPosition) { SendBoard(&second, backwardMostMove); if (appData.debugMode) {