summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorculler <culler>2017-10-30 17:34:28 (GMT)
committerculler <culler>2017-10-30 17:34:28 (GMT)
commit60d5bf93ccc95612d7bbed628289755086b8059f (patch)
tree5f78dda969953a38737d04527f108df97857e3a0
parent91f45c93108f532ca92137d37dd8b500aa0ef60b (diff)
downloadtk-60d5bf93ccc95612d7bbed628289755086b8059f.zip
tk-60d5bf93ccc95612d7bbed628289755086b8059f.tar.gz
tk-60d5bf93ccc95612d7bbed628289755086b8059f.tar.bz2
Edited the comment explaining why the logic in DisplayText needs
to be changed for macOS.
-rw-r--r--generic/tkTextDisp.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index d2b6147..24184e3 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -4443,18 +4443,28 @@ DisplayText(
#ifdef MAC_OSX_TK
} else if (dlPtr->chunkPtr != NULL) {
/*
- * On the Mac we need to redisplay all embedded windows which
- * were moved in order to make sure that the clipping region
- * for the Text widget is maintained correctly. If an embedded
- * window is moved but its bounding rectangle is not added back
- * to the clipping region of the Text widget then drawing into
- * the old bounding rectangle will not be allowed, causing an
- * image of the embedded window to remain on the screen in the
- * old position. In other words, a "ghost window" will appear.
+ * On macOS we need to redisplay all embedded windows which
+ * were moved by the call to TkScrollWindows above. This is
+ * not necessary on Unix or Windows because XScrollWindow will
+ * have included the bounding rectangles of all of these
+ * windows in the damage region. The macosx implementation of
+ * TkScrollWindow does not do this. It simply generates a
+ * damage region which is the scroll source rectangle minus
+ * the scroll destination rectangle. This is because there is
+ * no efficient process available for iterating through the
+ * subwindows which meet the scrolled area. (On Unix this is
+ * handled by GraphicsExpose events generated by XCopyArea and
+ * on Windows by ScrollWindowEx. On macOS the low level
+ * scrolling is accomplished by calling [view scrollRect:by:].
+ * This method does not provide any damage information and, in
+ * any case, could not be aware of Tk windows which were not
+ * based on NSView objects.
*
- * Perhaps all platforms should do this, rather than allow the
- * embedded windows to have incorrect values for Tk_X and Tk_Y.
- * But apparently this is not known to cause problems.
+ * On the other hand, this loop is already iterating through
+ * all embedded windows which could possibly have been moved
+ * by the scrolling. So it is as efficient to redisplay them
+ * here as it would have been if they had been redisplayed by
+ * the call to TextInvalidateRegion above.
*/
#else
} else if (dlPtr->chunkPtr != NULL && ((dlPtr->y < 0)