Fix makeKey makeMain with defered windows

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13927 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2002-06-22 03:44:57 +00:00
parent fb1641c28a
commit 6d2fb13215
3 changed files with 23 additions and 9 deletions

View file

@ -1,3 +1,14 @@
2002-06-21 Adam Fedor <fedor@gnu.org>
* Source/NSApplication.m (-finishLaunching): Use makeKeyWindow
not becomeKeyWindow.
* Source/NSWindow.m (-canBecomeKeyWindow): Conform to docs. don't
check if visible or miniaturized.
(-canBecomeMainWindow): Idem for miniaturized only.
(-makeKeyWindow): Check if visible, miniaturized.
(-makeMainWindow): Idem.
Wed Jun 19 15:54:39 2002 Georg Fleischmann <georg@vhf.de>
* Source/NSMenu.m ([-performActionForItemAtIndex:]): Select item

View file

@ -657,7 +657,7 @@ static NSCell* tileCell = nil;
if (_key_window == nil && _main_window == nil)
{
_key_window = [[self mainMenu] window];
[_key_window becomeKeyWindow];
[_key_window makeKeyWindow];
}
/*

View file

@ -1158,24 +1158,27 @@ static NSNotificationCenter *nc = nil;
}
}
/** Returns YES if the receiver can be made key. If this method returns
NO, the window will not be made key. This implementation returns YES
if the window is resizable or has a title bar. You can override this
method to change it's behavior */
- (BOOL) canBecomeKeyWindow
{
if (!_f.visible)
return NO;
if (_f.is_miniaturized)
return NO;
if ((NSResizableWindowMask | NSTitledWindowMask) & _styleMask)
return YES;
else
return NO;
}
/** Returns YES if the receiver can be the main window. If this method
returns NO, the window will not become the main window. This
implementation returns YES if the window is resizable or has a
title bar and is visible and is not an NSPanel. You can override
this method to change it's behavior */
- (BOOL) canBecomeMainWindow
{
if (!_f.visible)
return NO;
if (_f.is_miniaturized)
return NO;
if ((NSResizableWindowMask | NSTitledWindowMask) & _styleMask)
return YES;
else
@ -1235,7 +1238,7 @@ static NSNotificationCenter *nc = nil;
- (void) makeKeyWindow
{
if (_f.is_key == YES)
if (!_f.visible || _f.is_miniaturized || _f.is_key == YES)
{
return;
}
@ -1248,7 +1251,7 @@ static NSNotificationCenter *nc = nil;
- (void) makeMainWindow
{
if (_f.is_main == YES)
if (!_f.visible || _f.is_miniaturized || _f.is_main == YES)
{
return;
}