From cc45d0eb888820bbf28af832ea9c4bb8c1c6ccaf Mon Sep 17 00:00:00 2001 From: fedor Date: Sat, 22 Jun 2002 03:44:57 +0000 Subject: [PATCH] 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 --- ChangeLog | 11 +++++++++++ Source/NSApplication.m | 2 +- Source/NSWindow.m | 19 +++++++++++-------- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45b405686..ffe271fd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2002-06-21 Adam Fedor + + * 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 * Source/NSMenu.m ([-performActionForItemAtIndex:]): Select item diff --git a/Source/NSApplication.m b/Source/NSApplication.m index d9c286186..843375234 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -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]; } /* diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 4329aa0d4..6924db5d1 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -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; }