From 3a4dab519f8f01cd8d16d28af150bb2b07894b5f Mon Sep 17 00:00:00 2001 From: marc_culler Date: Wed, 15 Jul 2020 20:57:08 +0000 Subject: More fixes from [7ebdd17974] (thanks Christopher Chavez): remove the needsRedisplay flag, update comments. --- macosx/tkMacOSXDraw.c | 8 ++++---- macosx/tkMacOSXKeyEvent.c | 9 --------- macosx/tkMacOSXPrivate.h | 2 -- macosx/tkMacOSXSubwindows.c | 2 -- macosx/tkMacOSXWindowEvent.c | 4 ---- 5 files changed, 4 insertions(+), 21 deletions(-) diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 4973bc2..4304a3c 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -1642,13 +1642,13 @@ TkMacOSXSetupDrawingContext( * We can only draw into the view when the current CGContext is * valid and belongs to the view. Validity can only be guaranteed * inside of a view's drawRect or setFrame methods. The isDrawing - * attribute tells us whether we are being called from one of those - * methods. If the CGContext is not valid then we mark our view as - * needing display. + * attribute tells us whether we are being called from drawRect. + * If the CGContext is not valid then we mark our view as needing + * display. */ if (dc.clipRgn) { - [view addTkDirtyRect:clipBounds]; + [view addTkDirtyRect:NSRectFromCGRect(clipBounds)]; } else { [view addTkDirtyRect:[view bounds]]; } diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 9c22820..572e318 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -268,14 +268,6 @@ static NSUInteger textInputModifiers; @implementation TKContentView --(id)init { - self = [super init]; - if (self) { - _needsRedisplay = NO; - } - return self; -} - /* * Implementation of the NSTextInputClient protocol. */ @@ -551,7 +543,6 @@ static NSUInteger textInputModifiers; } /* End of NSTextInputClient implementation. */ -@synthesize needsRedisplay = _needsRedisplay; @end diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index a884b57..a77282c 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -422,11 +422,9 @@ VISIBILITY_HIDDEN { @private NSString *privateWorkingText; - Bool _needsRedisplay; Bool _tkNeedsDisplay; NSRect _tkDirtyRect; } -@property Bool needsRedisplay; @property Bool tkNeedsDisplay; @property NSRect tkDirtyRect; @end diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 77402a7..e6a6e6e 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -220,7 +220,6 @@ XMapWindow( TKContentView *view = [win contentView]; [view addTkDirtyRect:[view bounds]]; } - [[win contentView] setNeedsRedisplay:YES]; /* * Generate VisibilityNotify events for window and all mapped children. @@ -337,7 +336,6 @@ XUnmapWindow( TKContentView *view = [win contentView]; [view addTkDirtyRect:[view bounds]]; } - [[win contentView] setNeedsRedisplay:YES]; return Success; } diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 36a489b..5f52ea7 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -936,10 +936,6 @@ ConfigureRestrictProc( [NSApp setIsDrawing: YES]; [self clearTkDirtyRect]; [self generateExposeEvents:rect]; - if ([self needsRedisplay]) { - [self setNeedsRedisplay:NO]; - [self addTkDirtyRect: [self bounds]]; - } [NSApp setIsDrawing:NO]; #ifdef TK_MAC_DEBUG_DRAWING -- cgit v0.12