summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-01-12 22:29:37 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-01-12 22:29:37 (GMT)
commit728c0abfaa8116c37e42baa947aabde43a7eb1b3 (patch)
tree0302427b89ca39e0ce2c53b2310cae6875ea1555 /generic
parent72fd1bc135d0f147c889ac0a12a29fa34d01b356 (diff)
parente63bab777eed65bb380173f6f4e62e2e802e5456 (diff)
downloadtk-728c0abfaa8116c37e42baa947aabde43a7eb1b3.zip
tk-728c0abfaa8116c37e42baa947aabde43a7eb1b3.tar.gz
tk-728c0abfaa8116c37e42baa947aabde43a7eb1b3.tar.bz2
Merged core-8-5-branch
Diffstat (limited to 'generic')
-rw-r--r--generic/tkTextDisp.c34
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);