From: H.G. Muller Date: Sun, 14 Nov 2010 20:45:55 +0000 (+0100) Subject: Fix one-click moving on up-click X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=fdde71b442baec96a0c2769f18fce4de49e34426;p=xboard.git Fix one-click moving on up-click (First) up-clicks were not always ignored: in Edit-Game mode with one-click moving enabled this could lead to a capture being made on the down-click, and the recapture on the correspoding up-click. This has now been corrected, and only the down-click of a first click can lead to selecting a piece or a one-click move. --- diff --git a/backend.c b/backend.c index c48f16e..bd641fe 100644 --- a/backend.c +++ b/backend.c @@ -6399,8 +6399,14 @@ void LeftClick(ClickType clickType, int xPix, int yPix) if (fromX == -1) { gatingPiece = EmptySquare; + if (clickType != Press) { + if(dragging) { // [HGM] from-square must have been reset due to game end since last press + DragPieceEnd(xPix, yPix); dragging = 0; + DrawPosition(FALSE, NULL); + } + return; + } if(!appData.oneClick || !OnlyMove(&x, &y, FALSE)) { - if (clickType == Press) { /* First square */ if (OKToStartUserMove(x, y)) { fromX = x; @@ -6412,12 +6418,8 @@ void LeftClick(ClickType clickType, int xPix, int yPix) SetHighlights(x, y, -1, -1); } } - } else if(dragging) { // [HGM] from-square must have been reset due to game end since last press - DragPieceEnd(xPix, yPix); dragging = 0; - DrawPosition(FALSE, NULL); + return; } - return; - } } /* fromX != -1 */