diff options
author | fvogel <fvogelnew1@free.fr> | 2015-01-12 22:29:37 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2015-01-12 22:29:37 (GMT) |
commit | 728c0abfaa8116c37e42baa947aabde43a7eb1b3 (patch) | |
tree | 0302427b89ca39e0ce2c53b2310cae6875ea1555 /generic | |
parent | 72fd1bc135d0f147c889ac0a12a29fa34d01b356 (diff) | |
parent | e63bab777eed65bb380173f6f4e62e2e802e5456 (diff) | |
download | tk-728c0abfaa8116c37e42baa947aabde43a7eb1b3.zip tk-728c0abfaa8116c37e42baa947aabde43a7eb1b3.tar.gz tk-728c0abfaa8116c37e42baa947aabde43a7eb1b3.tar.bz2 |
Merged core-8-5-branch
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkTextDisp.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index dbed9c8..bddfa0e 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -3931,6 +3931,21 @@ TkTextUpdateOneLine( * *---------------------------------------------------------------------- */ +#ifdef MAC_OSX_TK +static void +RedisplayText( + ClientData clientData ) +{ + register TkText *textPtr = (TkText *) clientData; + TextDInfo *dInfoPtr = textPtr->dInfoPtr; + TkRegion damageRegion = TkCreateRegion(); + XRectangle rectangle = {0, 0, dInfoPtr->maxX, dInfoPtr->maxY}; + TkUnionRectWithRegion(&rectangle, damageRegion, damageRegion); + + TextInvalidateRegion(textPtr, damageRegion); + DisplayText(clientData); +} +#endif static void DisplayText( @@ -3945,6 +3960,9 @@ DisplayText( int bottomY = 0; /* Initialization needed only to stop compiler * warnings. */ Tcl_Interp *interp; +#ifdef MAC_OSX_TK + Tcl_TimerToken macRefreshTimer = NULL; +#endif if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { /* @@ -4147,6 +4165,22 @@ DisplayText( oldY, dInfoPtr->maxX-dInfoPtr->x, height, 0, y-oldY, damageRgn)) { TextInvalidateRegion(textPtr, damageRgn); + +#ifdef MAC_OSX_TK + + /* + * On OS X large scrolls sometimes leave garbage on the screen. + * This attempts to clean it up by redisplaying the Text window + * after 200 milliseconds. + */ + if ( abs(y-oldY) > 14 ) { + Tcl_DeleteTimerHandler(macRefreshTimer); + macRefreshTimer = Tcl_CreateTimerHandler(200, + RedisplayText, + clientData); + } +#endif + } numCopies++; TkDestroyRegion(damageRgn); |