From 67deaae2c9928dec8e096effef21fafc83141cd6 Mon Sep 17 00:00:00 2001 From: ovidiu Date: Wed, 22 Oct 1997 01:47:30 +0000 Subject: [PATCH] Incorporated Benhur Stein's bug fixes. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2544 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 8 ++++++++ Source/NSApplication.m | 5 +++++ Source/NSClipView.m | 10 ++-------- Source/NSView.m | 9 ++++++++- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 286e9fdc7..d4aa15d26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Tue Oct 21 18:25:14 1997 Ovidiu Predescu + + * Incorporated some bug fixes from Benhur Stein + . + * Source/NSApplication.m (setDelegate:): Register the delegate for + receiving notifications. + * Source/NSView.m (visibleRect): Implemented. + Tue Oct 21 16:21:06 1997 Ovidiu Predescu Fixed display optimization and the scrolling behavior in the presence diff --git a/Source/NSApplication.m b/Source/NSApplication.m index af9992ca8..acfd7fe02 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -866,6 +866,11 @@ static id NSApp; - (void)setDelegate:anObject { delegate = anObject; + + if ([delegate respondsToSelector:@selector(applicationDidFinishLaunching:)]) + [[NSNotificationCenter defaultCenter] addObserver:delegate + selector:@selector(applicationDidFinishLaunching:) + name:NSApplicationDidFinishLaunchingNotification object:self]; } // diff --git a/Source/NSClipView.m b/Source/NSClipView.m index c0f735990..5eb31c8e1 100644 --- a/Source/NSClipView.m +++ b/Source/NSClipView.m @@ -106,14 +106,8 @@ if (_copiesOnScroll) /* TODO: move the visible portion of the document */; - else { -#if 1 - [self setNeedsDisplay:YES]; -#else - [self display]; - [[self window] flushWindow]; -#endif - } + else + [_documentView setNeedsDisplay:YES]; } - (NSPoint)constrainScrollPoint:(NSPoint)proposedNewOrigin diff --git a/Source/NSView.m b/Source/NSView.m index 7be1591dd..d64d9064e 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -808,7 +808,14 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil; - (NSRect)visibleRect { - return bounds; + if (!super_view) + return bounds; + else { + NSRect superviewsVisibleRect + = [self convertRect:[super_view visibleRect] fromView:super_view]; + + return NSIntersectionRect (superviewsVisibleRect, frame); + } } - (void)_addSubviewForNeedingDisplay:(NSView*)view