From e08782709a8528d484d1cdf47a3d40a088362ab8 Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 17 Dec 1999 12:06:35 +0000 Subject: [PATCH] Tidied git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5553 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 9 +++++++++ Source/NSPopUpButton.m | 2 -- Source/NSView.m | 30 ++++++++---------------------- Source/NSWindow.m | 36 +++++++++++++----------------------- 4 files changed, 30 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog index ae5daffdc..3dba10d8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Fri Dec 17 12:03:00 1999 Richard Frith-Macdonald + + * Source/NSWindow.m: Remove some inefficient code that was calling + ([content_view superview]) when we now have the _wv ivar. + * Source/NSView.m: Fix another autodisplay problem - when an opaque + subview was being set as needing display AND another non-overlapping + subview was set for display, the opaque subview didn't get redrawn. + * Source/NSPopUpButton.m: removed an NSLog + 1999-12-16 Adam Fedor * New RTF parser from Stefan Bðhringer diff --git a/Source/NSPopUpButton.m b/Source/NSPopUpButton.m index 3377e70d2..1f3ad6c34 100644 --- a/Source/NSPopUpButton.m +++ b/Source/NSPopUpButton.m @@ -281,8 +281,6 @@ Class _nspopupbuttonCellClass = 0; [self sizeToFit]; - NSLog(@"synchronizeTitleAndSelectedItem"); - [self setNeedsDisplay: YES]; } diff --git a/Source/NSView.m b/Source/NSView.m index b83069da6..caa9097a3 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -1377,18 +1377,11 @@ GSSetDragTypes(NSView* obj, NSArray *types) if (coordinates_valid == NO) [self _rebuildCoordinates]; /* - * If this view is higher in the view hierarchy than one that - * actually needs display, it's invalidRect will be empty, so - * we need to set it to the visibleRect. + * If this view is higher in the view hierarchy than ones that + * actually needed display, it's invalidRect may not contain them + * so we need to display the union with the visibleRect. */ - if (NSIsEmptyRect(invalidRect) == YES) - { - rect = visibleRect; - } - else - { - rect = invalidRect; - } + rect = NSUnionRect(invalidRect, visibleRect); rect = [firstOpaque convertRect: rect fromView: self]; [firstOpaque displayIfNeededInRectIgnoringOpacity: rect]; } @@ -1404,18 +1397,11 @@ GSSetDragTypes(NSView* obj, NSArray *types) if (coordinates_valid == NO) [self _rebuildCoordinates]; /* - * If this view is higher in the view hierarchy than one that - * actually needs display, it's invalidRect will be empty, so - * we need to set it to the visibleRect. + * If this view is higher in the view hierarchy than ones that + * actually needed display, it's invalidRect may not contain them + * so we need to display the union with the visibleRect. */ - if (NSIsEmptyRect(invalidRect) == YES) - { - rect = visibleRect; - } - else - { - rect = invalidRect; - } + rect = NSUnionRect(invalidRect, visibleRect); [self displayIfNeededInRectIgnoringOpacity: rect]; } } diff --git a/Source/NSWindow.m b/Source/NSWindow.m index c7c530bae..0b70968cd 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -1003,7 +1003,7 @@ static NSMapTable* windowmaps = NULL; [first_responder becomeFirstResponder]; [self disableFlushWindow]; - [[content_view superview] display]; + [_wv display]; [self enableFlushWindow]; [self flushWindowIfNeeded]; } @@ -1012,7 +1012,7 @@ static NSMapTable* windowmaps = NULL; { if (_rFlags.needs_display) { - [[content_view superview] displayIfNeeded]; + [_wv displayIfNeeded]; _rFlags.needs_display = NO; } } @@ -1243,7 +1243,7 @@ discardCursorRectsForView(NSView *theView) - (void) discardCursorRects { - discardCursorRectsForView([content_view superview]); + discardCursorRectsForView(_wv); } - (void) enableCursorRects @@ -1292,7 +1292,7 @@ resetCursorRectsForView(NSView *theView) - (void) resetCursorRects { [self discardCursorRects]; - resetCursorRectsForView([content_view superview]); + resetCursorRectsForView(_wv); _f.cursor_rects_valid = YES; } @@ -2228,33 +2228,23 @@ resetCursorRectsForView(NSView *theView) source: (id)sourceObject slideBack: (BOOL)slideFlag { - /* - * Ensure we have a content view and it's associated window view. - */ - if (content_view == nil) - [self setContentView: nil]; - [[content_view superview] dragImage: anImage - at: baseLocation - offset: initialOffset - event: event - pasteboard: pboard - source: sourceObject - slideBack: slideFlag]; + [_wv dragImage: anImage + at: baseLocation + offset: initialOffset + event: event + pasteboard: pboard + source: sourceObject + slideBack: slideFlag]; } - (void) registerForDraggedTypes: (NSArray*)newTypes { - /* - * Ensure we have a content view and it's associated window view. - */ - if (content_view == nil) - [self setContentView: nil]; - [[content_view superview] registerForDraggedTypes: newTypes]; + [_wv registerForDraggedTypes: newTypes]; } - (void) unregisterDraggedTypes { - [[content_view superview] unregisterDraggedTypes]; + [_wv unregisterDraggedTypes]; } /*