diff --git a/ChangeLog b/ChangeLog index 9dc2d1fe6..427a609ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-01-05 03:39-EST Gregory John Casamento + + * Source/NSMenu.m: Do not show the menu at the top of the screen in + NSWindows95InterfaceStyle mode. + 2010-01-04 00:25-EST Gregory John Casamento * Source/GSWindowDecorationView.[hm]: Addition of ivars to track diff --git a/Source/NSMenu.m b/Source/NSMenu.m index 567712c9e..d29fb634b 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -108,6 +108,9 @@ /* Subclass of NSPanel since menus cannot become key */ @interface NSMenuPanel : NSPanel +{ + NSMenu *_the_menu; +} @end @interface NSMenuView (GNUstepPrivate) @@ -133,6 +136,11 @@ static BOOL menuBarVisible = YES; @implementation NSMenuPanel +- (void) _setmenu: (NSMenu *)menu +{ + _the_menu = menu; +} + - (BOOL) canBecomeKeyWindow { /* See [NSWindow-_lossOfKeyOrMainWindow] */ @@ -140,6 +148,20 @@ static BOOL menuBarVisible = YES; return YES; return NO; } + +- (void) orderFrontRegardless +{ + NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil); + if (style == NSWindows95InterfaceStyle) + { + // if we're the top level menu in Windows mode, don't show it. + if([_the_menu supermenu] == nil) + { + return; + } + } + [super orderFrontRegardless]; +} @end @implementation NSMenu (GNUstepPrivate) @@ -185,6 +207,7 @@ static BOOL menuBarVisible = YES; [win setLevel: NSSubmenuWindowLevel]; [win setWorksWhenModal: NO]; [win setBecomesKeyOnlyIfNeeded: YES]; + [win _setmenu: self]; return win; } @@ -1328,10 +1351,12 @@ static BOOL menuBarVisible = YES; * menu, we will still have it recorded as ours, but it won't be * in our view hierarchy, so we have to re-add it. */ + /* if (contentView != [menuRep superview]) { [contentView addSubview: menuRep]; } + */ return; }