From 243fc9b651d187f1455e75470374f27a44ad7423 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 17 Oct 2017 20:06:39 +0000 Subject: New patch from Marc Culler aiming at fixing [fab5fed65e] without breaking again [92e614e612] nor [40a9abb9db]. --- generic/tkTextDisp.c | 2 -- macosx/tkMacOSXDraw.c | 14 +++----------- macosx/tkMacOSXPrivate.h | 1 - macosx/tkMacOSXWindowEvent.c | 8 +------- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 39a57eb..623882d 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -4298,9 +4298,7 @@ DisplayText( if (TkScrollWindow(textPtr->tkwin, dInfoPtr->scrollGC, dInfoPtr->x, oldY, dInfoPtr->maxX-dInfoPtr->x, height, 0, y-oldY, damageRgn)) { -#ifndef MAC_OSX_TK TextInvalidateRegion(textPtr, damageRgn); -#endif } numCopies++; TkDestroyRegion(damageRgn); diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 5252ce9..65c9610 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -1508,7 +1508,8 @@ TkScrollWindow( Drawable drawable = Tk_WindowId(tkwin); MacDrawable *macDraw = (MacDrawable *) drawable; TKContentView *view = (TKContentView *)TkMacOSXDrawableView(macDraw); - CGRect srcRect, dstRect; + TkWindow *winPtr = (TkWindow *)tkwin, *childPtr; + CGRect srcRect, dstRect, childBounds; HIShapeRef dmgRgn = NULL, extraRgn = NULL; NSRect bounds, visRect, scrollSrc, scrollDst; int result = 0; @@ -1541,9 +1542,8 @@ TkScrollWindow( ChkErr(HIShapeDifference, dmgRgn, extraRgn, (HIMutableShapeRef) dmgRgn); result = HIShapeIsEmpty(dmgRgn) ? 0 : 1; - /* Convert to Tk coordinates. */ + /* Convert to Tk coordinates, offset by the window origin. */ TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); - TkMacOSXOffsetRegion(damageRgn, -macDraw->xOff, -macDraw->yOff); if (extraRgn) { CFRelease(extraRgn); } @@ -1552,9 +1552,6 @@ TkScrollWindow( [view scrollRect:scrollSrc by:NSMakeSize(dx, -dy)]; /* Shift the Tk children which meet the source rectangle. */ - TkWindow *winPtr = (TkWindow *)tkwin; - TkWindow *childPtr; - CGRect childBounds; for (childPtr = winPtr->childList; childPtr != NULL; childPtr = childPtr->nextPtr) { if (Tk_IsMapped(childPtr) && !Tk_IsTopLevel(childPtr)) { TkMacOSXWinCGBounds(childPtr, &childBounds); @@ -1571,11 +1568,6 @@ TkScrollWindow( } } TkMacOSXInvalidateWindow(macDraw, TK_WINDOW_ONLY); - - /* Queue up Expose events for the damage region. */ - int oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE); - [view generateExposeEvents:dmgRgn childrenOnly:1]; - Tcl_SetServiceMode(oldMode); } } else { dmgRgn = HIShapeCreateEmpty(); diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 6248c5a..e3c9464 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -344,7 +344,6 @@ VISIBILITY_HIDDEN @interface TKContentView(TKWindowEvent) - (void) drawRect: (NSRect) rect; - (void) generateExposeEvents: (HIShapeRef) shape; -- (void) generateExposeEvents: (HIShapeRef) shape childrenOnly: (int) childrenOnly; - (void) viewDidEndLiveResize; - (void) tkToolbarButton: (id) sender; - (BOOL) isOpaque; diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 137ba31..8873c82 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -915,16 +915,10 @@ ConfigureRestrictProc( */ - (void) generateExposeEvents: (HIShapeRef) shape { - [self generateExposeEvents:shape childrenOnly:0]; -} - -- (void) generateExposeEvents: (HIShapeRef) shape - childrenOnly: (int) childrenOnly -{ - TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); unsigned long serial; CGRect updateBounds; int updatesNeeded; + TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); if (!winPtr) { return; -- cgit v0.12