diff --git a/ChangeLog b/ChangeLog index e0c8922b0..dc053100a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-01-24 Wolfgang Lux + + * Source/NSWindow.m (-setFrameFromString:, -stringWithSavedFrame): + Do not include an in-window menu in a window's saved frame either. + 2011-01-24 Fred Kiefer * Headers/AppKit/NSViewController.h, diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 3f25ffded..6bcbdcd5c 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -4606,10 +4606,17 @@ current key view.
// if toolbar is showing, adjust saved frame to add the toolbar back in if ([_toolbar isVisible]) { - int toolbarHeight = [[_toolbar _toolbarView] frame].size.height; + float toolbarHeight = [[_toolbar _toolbarView] frame].size.height; fRect.size.height += toolbarHeight; fRect.origin.y -= toolbarHeight; } + // if window has a menu, adjust saved frame to add the menu back in + if ([_wv hasMenu]) + { + float menuBarHeight = [[GSTheme theme] menuHeightForWindow: self]; + fRect.size.height -= menuBarHeight; + fRect.origin.y -= menuBarHeight; + } /* * Scan in the frame for the area the window was placed in in screen. @@ -4739,10 +4746,17 @@ current key view.
// if toolbar is showing, adjust saved frame to not include the toolbar if ([_toolbar isVisible]) { - int toolbarHeight = [[_toolbar _toolbarView] frame].size.height; + float toolbarHeight = [[_toolbar _toolbarView] frame].size.height; fRect.size.height -= toolbarHeight; fRect.origin.y += toolbarHeight; } + // if window has a menu, adjust saved frame to not include the menu + if ([_wv hasMenu]) + { + float menuBarHeight = [[GSTheme theme] menuHeightForWindow: self]; + fRect.size.height -= menuBarHeight; + fRect.origin.y += menuBarHeight; + } /* * The screen rectangle should give the area of the screen in which