Fixed the behaviour of menu in window when hide the app

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31859 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Germán Arias 2011-01-09 06:10:02 +00:00
parent 90687109f7
commit bf270ebcfb
3 changed files with 23 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2011-01-09 German Arias <german@xelalug.org>
* Source/NSApplication.m (-activateIgnoringOtherApps:):
If we have menu in window, set a main window when unhide.
* Source/NSWindow.m (-resignMainWindow): Close the menu
in window if resign main window.
2011-01-08 German Arias <german@xelalug.org> 2011-01-08 German Arias <german@xelalug.org>
* Source/NSMenuView.m (-trackWithEvent:): * Source/NSMenuView.m (-trackWithEvent:):

View file

@ -1297,6 +1297,14 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
if ([self keyWindow] != nil) if ([self keyWindow] != nil)
{ {
[[self keyWindow] orderFront: self]; [[self keyWindow] orderFront: self];
/* If menu is in window, we need a main window, in other way
the menu can't respond */
if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", self) ==
NSWindows95InterfaceStyle && [[self keyWindow] canBecomeMainWindow])
{
[[self keyWindow] becomeMainWindow];
}
} }
else if ([self mainWindow] != nil) else if ([self mainWindow] != nil)
{ {

View file

@ -1818,6 +1818,14 @@ many times.
if (_f.is_main == YES) if (_f.is_main == YES)
{ {
_f.is_main = NO; _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) if (_f.is_key == YES)
{ {
[_wv setInputState: GSTitleBarKey]; [_wv setInputState: GSTitleBarKey];