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).
XtSetValues(sh, args, j);
}
+static XtIntervalId delayedDragID = 0;
+
void
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