From: H.G. Muller Date: Thu, 8 Mar 2012 10:11:03 +0000 (+0100) Subject: Limit premove cancelling to click on from square X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=f3a5e498cf34b4f2f0a1edc54432a04ea320949a;p=xboard.git Limit premove cancelling to click on from square On second thought it might be better to limit cancellation of the premove to up-clicks on the premove from-square. (Presumably this will be a static click, but if the down-click was elsewhere, a new move most have been entered, which would clear the existing premove anyway.) This allows the user to already grab another piece that he wants to move after premove, or when premove is rejected. --- diff --git a/backend.c b/backend.c index d1f3b04..f420925 100644 --- a/backend.c +++ b/backend.c @@ -6886,7 +6886,8 @@ LeftClick (ClickType clickType, int xPix, int yPix) || x == BOARD_RGHT+1 && y >= gameInfo.holdingsSize) ) return; - if(gotPremove && clickType == Press) { // user starts something after premove has been entered: abort premove as side effect + if(gotPremove && x == premoveFromX && y == premoveFromY && clickType == Release) { + // could be static click on premove from-square: abort premove gotPremove = 0; ClearPremoveHighlights(); }