diff --git a/ChangeLog b/ChangeLog
index f885b6554..562afe2ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-01-15 German Arias
See Also: -applicationIconImage
[_hidden_key resignKeyWindow]; } + // The main window is saved for when the app is activated again. + // This is necessary for menu in window. + if ([self mainWindow] != nil) + { + _hidden_main = [self mainWindow]; + [_hidden_main resignMainWindow]; + } + windows_list = GSOrderedWindows(); iter = [windows_list reverseObjectEnumerator]; diff --git a/Source/NSMenuView.m b/Source/NSMenuView.m index 762078d13..faf88a7bd 100644 --- a/Source/NSMenuView.m +++ b/Source/NSMenuView.m @@ -1389,14 +1389,21 @@ static NSMapTable *viewInfo = 0; - (BOOL) _executeItemAtIndex: (int)indexOfActionToExecute removeSubmenu: (BOOL)subMenusNeedRemoving { + NSInterfaceStyle style = + NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", self); + + /*If we have menu in window, close the menu after select + an option*/ + if (style == NSWindows95InterfaceStyle) + { + [[[[NSApp mainWindow] menu] attachedMenu] close]; + } + if (indexOfActionToExecute >= 0 && [_attachedMenu attachedMenu] != nil && [_attachedMenu attachedMenu] == [[_items_link objectAtIndex: indexOfActionToExecute] submenu]) { - NSInterfaceStyle style = - NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", self); - if (style == NSMacintoshInterfaceStyle || - style == NSWindows95InterfaceStyle) + if (style == NSMacintoshInterfaceStyle) { // On Macintosh, clicking on or releasing the mouse over a // submenu item always closes the menu (if it is open) and @@ -1405,6 +1412,11 @@ static NSMapTable *viewInfo = 0; return YES; } + if (style == NSWindows95InterfaceStyle) + { + return YES; + } + if (subMenusNeedRemoving) { [self detachSubmenu]; diff --git a/Source/NSSavePanel.m b/Source/NSSavePanel.m index 331edd5fe..77a844092 100644 --- a/Source/NSSavePanel.m +++ b/Source/NSSavePanel.m @@ -50,7 +50,6 @@ #import "AppKit/NSImage.h" #import "AppKit/NSImageView.h" #import "AppKit/NSMatrix.h" -#import "AppKit/NSMenu.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSDragging.h" #import "AppKit/NSSavePanel.h" @@ -183,7 +182,6 @@ setPath(NSBrowser *browser, NSString *path) NSImage *image; NSRect r; id lastKeyView; - NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil); // Track window resizing so we can change number of browser columns. [[NSNotificationCenter defaultCenter] addObserver: self @@ -375,12 +373,6 @@ setPath(NSBrowser *browser, NSString *path) [self registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, nil]]; - - if (style == NSWindows95InterfaceStyle) - { - [[[[NSApp mainWindow] menu] attachedMenu] close]; - } - return self; } diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 949f43061..fc10144dd 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -1818,14 +1818,6 @@ many times. if (_f.is_main == YES) { _f.is_main = NO; - - //We close the menu if the app will be hide - if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", self) == - NSWindows95InterfaceStyle) - { - [[[self menu] attachedMenu] close]; - } - if (_f.is_key == YES) { [_wv setInputState: GSTitleBarKey];