summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogelnew1@free.fr <fvogel>2015-01-12 22:29:37 (GMT)
committerfvogelnew1@free.fr <fvogel>2015-01-12 22:29:37 (GMT)
commit53b9c7d95e021b9e7f44b2b9b0a1a6595d74e884 (patch)
treee30b6bf1cb6d35854b221654863ad0ddc5bf59aa /generic
parenta2f6fa61acdd4b987d232fd5fcb8a2fb20d870e0 (diff)
parent3c37fdaa4221a9cd947e3e2487a29e41c8b43be4 (diff)
downloadtk-53b9c7d95e021b9e7f44b2b9b0a1a6595d74e884.zip
tk-53b9c7d95e021b9e7f44b2b9b0a1a6595d74e884.tar.gz
tk-53b9c7d95e021b9e7f44b2b9b0a1a6595d74e884.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);