summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-12-13 20:10:47 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-12-13 20:10:47 (GMT)
commitf9684bb9628898c72e0372871542a674f8389312 (patch)
tree24af41e09fc2eff88fd59cd53fa3e7fda38523ac /generic/tkTextDisp.c
parente6a82e18a1f52de96da71d0b31a1bb3f46ed7ba1 (diff)
parent47c6cf375321a9f00b0446e3753d6f9d8c357cd8 (diff)
downloadtk-f9684bb9628898c72e0372871542a674f8389312.zip
tk-f9684bb9628898c72e0372871542a674f8389312.tar.gz
tk-f9684bb9628898c72e0372871542a674f8389312.tar.bz2
Merged core-8-5-branch
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 9738c95..108cc4a 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -659,17 +659,8 @@ TkTextCreateDInfo(
dInfoPtr->metricEpoch = -1;
dInfoPtr->metricIndex.textPtr = NULL;
dInfoPtr->metricIndex.linePtr = NULL;
-
- /*
- * Add a refCount for each of the idle call-backs.
- */
-
- textPtr->refCount++;
- dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(0,
- AsyncUpdateLineMetrics, (ClientData) textPtr);
- textPtr->refCount++;
- dInfoPtr->scrollbarTimer = Tcl_CreateTimerHandler(200,
- AsyncUpdateYScrollbar, (ClientData) textPtr);
+ dInfoPtr->lineUpdateTimer = NULL;
+ dInfoPtr->scrollbarTimer = NULL;
textPtr->dInfoPtr = dInfoPtr;
}
@@ -2913,9 +2904,10 @@ AsyncUpdateLineMetrics(
dInfoPtr->lineUpdateTimer = NULL;
- if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) {
+ if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)
+ || !Tk_IsMapped(textPtr->tkwin)) {
/*
- * The widget has been deleted. Don't do anything.
+ * The widget has been deleted, or is not mapped. Don't do anything.
*/
if (--textPtr->refCount == 0) {
@@ -5302,6 +5294,15 @@ TkTextSetYView(
}
/*
+ * If the window height is smaller than the line height, prefer to make
+ * the top of the line visible.
+ */
+
+ if (dInfoPtr->maxY - dInfoPtr->y < lineHeight) {
+ bottomY = lineHeight;
+ }
+
+ /*
* Our job now is to arrange the display so that indexPtr appears as low
* on the screen as possible but with its bottom no lower than bottomY.
* BottomY is the bottom of the window if the desired line is just below