From: H.G. Muller Date: Mon, 26 Aug 2013 12:40:57 +0000 (+0200) Subject: Fix grabbing of selected piece X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=6ae4cea03c0da1fa1d3e3ecd3ffddc17931cc852;p=xboard.git Fix grabbing of selected piece A second static click on a selected piece should deselect it, but an attempt to drag an already selected piece should not 'bounce off'. It was already possible to move a selected piece to another square, but the dragging was not animated. This is now fixed, by only skipping the code to start dragging when the second click is part of the only-move double-click for only capture. (Before it was skipped on any second click.) --- diff --git a/backend.c b/backend.c index 4c30250..12c847d 100644 --- a/backend.c +++ b/backend.c @@ -7223,7 +7223,7 @@ LeftClick (ClickType clickType, int xPix, int yPix) } promoDefaultAltered = FALSE; MarkTargetSquares(1); - if(!second || appData.oneClick && !OnlyMove(&x, &y, TRUE)) { + if(!(second && appData.oneClick && OnlyMove(&x, &y, TRUE))) { if (appData.highlightDragging) { SetHighlights(x, y, -1, -1); } else { @@ -7273,6 +7273,7 @@ LeftClick (ClickType clickType, int xPix, int yPix) second = sweepSelecting = 0; fromX = fromY = -1; gatingPiece = EmptySquare; + MarkTargetSquares(1); ClearHighlights(); gotPremove = 0; ClearPremoveHighlights();