From: H.G. Muller Date: Thu, 12 Apr 2012 21:49:27 +0000 (+0200) Subject: Fix double promotion popup X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=d5d8657d11578db0c80c16bfc592cfa3d308ef18;p=xboard.git Fix double promotion popup Only the up-click of a click-click move gives a promotion popup now. --- diff --git a/backend.c b/backend.c index 8021102..afe428e 100644 --- a/backend.c +++ b/backend.c @@ -7182,7 +7182,14 @@ LeftClick (ClickType clickType, int xPix, int yPix) if(x >= BOARD_LEFT && x < BOARD_RGHT) clearFlag = 1; // and defer click-click move of empty-square to up-click return; } - if(appData.sweepSelect && HasPromotionChoice(fromX, fromY, toX, toY, &promoChoice, FALSE)) { + /* Finish clickclick move */ + if (appData.animate || appData.highlightLastMove) { + SetHighlights(fromX, fromY, toX, toY); + } else { + ClearHighlights(); + } + if(HasPromotionChoice(fromX, fromY, toX, toY, &promoChoice, FALSE)) { + if(appData.sweepSelect) { ChessSquare piece = boards[currentMove][fromY][fromX]; DragPieceBegin(xPix, yPix, TRUE); dragging = 1; promoSweep = defaultPromoChoice; @@ -7191,13 +7198,8 @@ LeftClick (ClickType clickType, int xPix, int yPix) Sweep(0); // Pawn that is going to promote: preview promotion piece DisplayMessage("", _("Pull pawn backwards to under-promote")); DrawPosition(FALSE, boards[currentMove]); - return; - } - /* Finish clickclick move */ - if (appData.animate || appData.highlightLastMove) { - SetHighlights(fromX, fromY, toX, toY); - } else { - ClearHighlights(); + } + return; // promo popup appears on up-click } } else { /* Finish drag move */