From 34f7052ac28c514b757fe7315c7e653af0425783 Mon Sep 17 00:00:00 2001 From: Doug Simons Date: Tue, 20 Apr 2010 19:37:10 +0000 Subject: [PATCH] fix problems with overlaps between toolbars, window contents, and in-window menus git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30206 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++++ Source/GSWindowDecorationView.m | 16 +++++++--------- Source/NSWindow.m | 6 ------ 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 96a846372..b5f878789 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-04-20 Doug Simons + + * Source/NSWindow.m: + * Source/GSWindowDecorationView.m: + Fix problems with in-window menus sometimes overlapping toolbars or + toolbars overlapping window contents. + 2010-04-19 Doug Simons * Source/NSMatrix.m: diff --git a/Source/GSWindowDecorationView.m b/Source/GSWindowDecorationView.m index edd769b15..44cd1636c 100644 --- a/Source/GSWindowDecorationView.m +++ b/Source/GSWindowDecorationView.m @@ -213,17 +213,9 @@ - (void) setContentView: (NSView *)contentView { - NSSize oldSize; - [contentView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [self addSubview: contentView]; - - oldSize = [contentView frame].size; - oldSize.width += _frame.size.width - contentRect.size.width; - oldSize.height += _frame.size.height - contentRect.size.height; - [contentView resizeWithOldSuperviewSize: oldSize]; - [contentView setFrameOrigin: NSMakePoint(contentRect.origin.x, - contentRect.origin.y)]; + [self layout]; } - (void) setDocumentEdited: (BOOL)flag @@ -239,6 +231,7 @@ NSRect contentViewFrame; NSToolbar *tb = [_window toolbar]; NSRect frame = [window frame]; + NSView *windowContentView = [_window contentView]; frame.origin = NSZeroPoint; contentViewFrame = [isa contentRectForFrameRect: frame @@ -282,6 +275,10 @@ contentViewFrame.size.height -= newToolbarViewHeight; } } + if ([windowContentView superview] == self) + { + [windowContentView setFrame:contentViewFrame]; + } } - (void) changeWindowHeight: (float)difference @@ -307,6 +304,7 @@ // then resize the window [window setFrame: windowFrame display: YES]; + [self layout]; } /* diff --git a/Source/NSWindow.m b/Source/NSWindow.m index e79783a78..82ba2c4e9 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -1816,12 +1816,6 @@ many times. { [_wv setInputState: GSTitleBarNormal]; } - if ([self menu] == [NSApp mainMenu]) - { - /* This window contains the main menu ... remove it. - */ - [self setMenu: nil]; - } [nc postNotificationName: NSWindowDidResignMainNotification object: self]; } }