mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-11 08:48:06 +01:00
Force redraw after timer fires. This allows scrolling to happen
during drag, but isn't the right fix. The timerProc should probably return a boolean indicating whether redraw is needed.
This commit is contained in:
parent
cde4a4dd6b
commit
4518bbdc05
1 changed files with 10 additions and 3 deletions
|
@ -1786,9 +1786,10 @@ handleScroll( CEAppGlobals* globals, XP_S16 pos, /* only valid for THUMB* */
|
||||||
} /* handleScroll */
|
} /* handleScroll */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static XP_Bool
|
||||||
ceFireTimer( CEAppGlobals* globals, XWTimerReason why )
|
ceFireTimer( CEAppGlobals* globals, XWTimerReason why )
|
||||||
{
|
{
|
||||||
|
XP_Bool draw = XP_FALSE;
|
||||||
XWTimerProc proc;
|
XWTimerProc proc;
|
||||||
void* closure;
|
void* closure;
|
||||||
|
|
||||||
|
@ -1797,9 +1798,15 @@ ceFireTimer( CEAppGlobals* globals, XWTimerReason why )
|
||||||
globals->timerProcs[why] = NULL;
|
globals->timerProcs[why] = NULL;
|
||||||
closure = globals->timerClosures[why];
|
closure = globals->timerClosures[why];
|
||||||
(*proc)( closure, why );
|
(*proc)( closure, why );
|
||||||
|
/* Setting draw after firing timer allows scrolling to happen
|
||||||
|
while pen is held down. This is a hack. Perhaps having
|
||||||
|
the timer proc return whether drawing is needed would be
|
||||||
|
more consistent. */
|
||||||
|
draw = XP_TRUE;
|
||||||
} else {
|
} else {
|
||||||
XP_LOGF( "skipped timer; alread fired?" );
|
XP_LOGF( "skipped timer; alread fired?" );
|
||||||
}
|
}
|
||||||
|
return draw;
|
||||||
} /* ceFireTimer */
|
} /* ceFireTimer */
|
||||||
|
|
||||||
/* WM_TIMER messages are low-priority. Hold a key down and key events will
|
/* WM_TIMER messages are low-priority. Hold a key down and key events will
|
||||||
|
@ -1825,7 +1832,7 @@ checkFireLateKeyTimer( CEAppGlobals* globals )
|
||||||
XWTimerReason why = whys[i];
|
XWTimerReason why = whys[i];
|
||||||
if ( !!globals->timerProcs[why] ) {
|
if ( !!globals->timerProcs[why] ) {
|
||||||
if ( now >= globals->timerWhens[why] ) {
|
if ( now >= globals->timerWhens[why] ) {
|
||||||
ceFireTimer( globals, why );
|
(void)ceFireTimer( globals, why );
|
||||||
drop = XP_TRUE;
|
drop = XP_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2218,7 +2225,7 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
as fired proc may set another. */
|
as fired proc may set another. */
|
||||||
(void)KillTimer( hWnd, globals->timerIDs[why] );
|
(void)KillTimer( hWnd, globals->timerIDs[why] );
|
||||||
|
|
||||||
ceFireTimer( globals, why );
|
draw = ceFireTimer( globals, why );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue