From: H.G. Muller Date: Fri, 16 Mar 2012 13:47:25 +0000 (+0100) Subject: Fix clock stop after dragging X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=343c61701b7a30cb7b6947825c7afb4a16b97fd6;p=xboard.git Fix clock stop after dragging DelayedDrag always cancelled the previous drag timeout event, even when this was no longer pending because it had already taken place, and the event ID was resused by some other timeout (usually a clock tick). --- diff --git a/xboard.c b/xboard.c index 80db398..097cb85 100644 --- a/xboard.c +++ b/xboard.c @@ -4708,6 +4708,8 @@ CoDrag (Widget sh, WindowPlacement *wp) XtSetValues(sh, args, j); } +static XtIntervalId delayedDragID = 0; + void DragProc () { @@ -4721,13 +4723,13 @@ DragProc () if(GameListIsUp()) CoDrag(gameListShell, &wpGameList); wpMain = wpNew; XDrawPosition(boardWidget, True, NULL); + delayedDragID = 0; // now drag executed, make sure next DelayedDrag will not cancel timer event (which could now be used by other) } void DelayedDrag () { - static XtIntervalId delayedDragID = 0; if(delayedDragID) XtRemoveTimeOut(delayedDragID); // cancel pending delayedDragID = XtAppAddTimeOut(appContext, 50, (XtTimerCallbackProc) DragProc, (XtPointer) 0); // and schedule new one 50 msec later