From 20e5273f5b6208576bf9bc900e4cff39d724cb7f Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 5 Dec 2015 13:31:00 +0000 Subject: Fix for bug [ff8a1e55a2] - Filling a never-mapped text widget is CPU hungry - Patch from Koen Danckaert --- generic/tkTextDisp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index cfe6e7a..0665ba7 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2923,7 +2923,8 @@ AsyncUpdateLineMetrics( return; } - if (dInfoPtr->flags & REDRAW_PENDING) { + if ((dInfoPtr->flags & REDRAW_PENDING) || !Tk_IsMapped(textPtr->tkwin) + || dInfoPtr->maxX <= dInfoPtr->x || dInfoPtr->maxY <= dInfoPtr->y) { dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(1, AsyncUpdateLineMetrics, clientData); return; -- cgit v0.12