From 343c61701b7a30cb7b6947825c7afb4a16b97fd6 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Fri, 16 Mar 2012 14:47:25 +0100 Subject: [PATCH] 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). --- xboard.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) 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 -- 1.7.0.4