diff --git a/ChangeLog b/ChangeLog index b5516d92b..b289b44e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-11-24 Matt Rice + + * Source/NSWindowController.m (_windowDidLoad:): Pass an NSZeroPoint to + cascadeTopLeftFromPoint: on the first call. + 2006-11-23 Matt Rice * Source/NSTableView.m (_trackCellAtColumn:row:withEvent:): diff --git a/Source/NSWindowController.m b/Source/NSWindowController.m index f3699923e..35053d30f 100644 --- a/Source/NSWindowController.m +++ b/Source/NSWindowController.m @@ -401,30 +401,16 @@ if ([self shouldCascadeWindows]) { - static NSPoint nextWindowLocation = { 0.0, 0.0 }; - static BOOL firstWindow = YES; - - if (firstWindow) - { - NSRect windowFrame = [_window frame]; - - /* Start with the frame as set */ - nextWindowLocation = NSMakePoint (NSMinX (windowFrame), - NSMaxY (windowFrame)); - firstWindow = NO; - } - else - { - /* - * cascadeTopLeftFromPoint will "wrap" the point back to the - * top left if the normal cascading will cause the window to go - * off the screen. In Apple's implementation, this wraps to the - * extreme top of the screen, and offset only a small amount - * from the left. - */ - nextWindowLocation + static NSPoint nextWindowLocation = { 0.0, 0.0 }; + /* + * cascadeTopLeftFromPoint will "wrap" the point back to the + * top left if the normal cascading will cause the window to go + * off the screen. In Apple's implementation, this wraps to the + * extreme top of the screen, and offset only a small amount + * from the left. + */ + nextWindowLocation = [_window cascadeTopLeftFromPoint: nextWindowLocation]; - } } [self windowDidLoad];