From: H.G.Muller Date: Mon, 17 Nov 2014 12:00:37 +0000 (+0100) Subject: stash X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=2392a87503272e7ae1dcaa6aa8628955dc5493d1;p=xboard.git stash --- diff --git a/backend.c b/backend.c index f969aba..6bf57ac 100644 --- a/backend.c +++ b/backend.c @@ -7495,7 +7495,7 @@ LeftClick (ClickType clickType, int xPix, int yPix) return; } } - +printf("to click %d,%d\n",x,y); /* fromX != -1 */ if (clickType == Press && gameMode != EditPosition) { ChessSquare fromP; @@ -7558,6 +7558,12 @@ LeftClick (ClickType clickType, int xPix, int yPix) // ignore clicks on holdings if(x < BOARD_LEFT || x >= BOARD_RGHT) return; } +printf("A type=%d\n",clickType); + + if(x == fromX && y == fromY && gameMode == EditPosition && SubtractTimeMarks(&lastClickTime, &prevClickTime) < 200) { + gatingPiece = boards[currentMove][fromY][fromX]; // prepare to copy rather than move + return; + } if (clickType == Release && x == fromX && y == fromY && killX < 0) { DragPieceEnd(xPix, yPix); dragging = 0; @@ -7591,7 +7597,7 @@ LeftClick (ClickType clickType, int xPix, int yPix) } clearFlag = 0; - +printf("B\n"); if(gameMode != EditPosition && !appData.testLegality && !legal[y][x] && fromX >= BOARD_LEFT && fromX < BOARD_RGHT && (x != killX || y != killY) && !sweepSelecting) { if(dragging) DragPieceEnd(xPix, yPix), dragging = 0; @@ -7599,7 +7605,7 @@ LeftClick (ClickType clickType, int xPix, int yPix) DrawPosition(TRUE, NULL); return; // ignore to-click } - +printf("(%d,%d)-(%d,%d) %d %d\n",fromX,fromY,toX,toY,x,y); /* we now have a different from- and (possibly off-board) to-square */ /* Completed move */ if(!sweepSelecting) {