diff options
author | Kevin Walzer <kw@codebykevin.com> | 2015-02-19 02:27:14 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2015-02-19 02:27:14 (GMT) |
commit | 85a2a651bd79c8d724f04ecec7439b7b4332ee3e (patch) | |
tree | 3e8930148e0acb4e0ad0c2b46a72c2f3eba96983 /macosx/tkMacOSXDraw.c | |
parent | 8ba8aeb4d8cc82ddb494f9c8c8a9cf2620b5df4d (diff) | |
download | tk-85a2a651bd79c8d724f04ecec7439b7b4332ee3e.zip tk-85a2a651bd79c8d724f04ecec7439b7b4332ee3e.tar.gz tk-85a2a651bd79c8d724f04ecec7439b7b4332ee3e.tar.bz2 |
Restore live resize to Cocoa with reduced flickering; addresses most serious issue of Cocoa drawing while preserving user expectations for display during window resize; thanks to Marc Culler for extensive patch
Diffstat (limited to 'macosx/tkMacOSXDraw.c')
-rw-r--r-- | macosx/tkMacOSXDraw.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 0b39cb4..f94c8af 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -1508,11 +1508,6 @@ TkScrollWindow( /* Scroll the rectangle. */ [view scrollRect:scrollSrc by:NSMakeSize(dx, -dy)]; - - /* Redisplay the scrolled area; hide to reduce flicker after removal of private API calls. */ - [view setHidden:YES]; - [view displayRect:scrollDst]; - [view setHidden:NO]; } } @@ -1857,9 +1852,9 @@ TkpClipDrawableToRect( macDraw->drawRgn = NULL; } if (width >= 0 && height >= 0) { - CGRect drawRect = CGRectMake(x + macDraw->xOff, y + macDraw->yOff, + CGRect clipRect = CGRectMake(x + macDraw->xOff, y + macDraw->yOff, width, height); - HIShapeRef drawRgn = HIShapeCreateWithRect(&drawRect); + HIShapeRef drawRgn = HIShapeCreateWithRect(&clipRect); if (macDraw->winPtr && macDraw->flags & TK_CLIP_INVALID) { TkMacOSXUpdateClipRgn(macDraw->winPtr); @@ -1872,9 +1867,9 @@ TkpClipDrawableToRect( macDraw->drawRgn = drawRgn; } if (view && view != [NSView focusView] && [view lockFocusIfCanDraw]) { - drawRect.origin.y = [view bounds].size.height - - (drawRect.origin.y + drawRect.size.height); - NSRectClip(NSRectFromCGRect(drawRect)); + clipRect.origin.y = [view bounds].size.height - + (clipRect.origin.y + clipRect.size.height); + NSRectClip(NSRectFromCGRect(clipRect)); macDraw->flags |= TK_FOCUSED_VIEW; } } else { |