Misc updates to tidy NSWindow and to correct behavior on app activation

and deactivation.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5192 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-11-15 21:45:56 +00:00
parent 947dcdb83f
commit 74a48160e6
10 changed files with 270 additions and 226 deletions

View file

@ -182,16 +182,6 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
selector: @selector(_showTornOffMenuIfAny:)
name: NSApplicationWillFinishLaunchingNotification
object: theApp];
[defaultCenter addObserver: self
selector: @selector(_deactivate:)
name: NSApplicationWillResignActiveNotification
object: theApp];
[defaultCenter addObserver: self
selector: @selector(_activate:)
name: NSApplicationWillBecomeActiveNotification
object: theApp];
return self;
}
@ -770,17 +760,6 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
@end
@implementation NSMenu (GNUstepPrivate)
- (void) _activate: (NSNotification*)notification
{
if (menu_is_visible)
[aWindow orderFrontRegardless];
}
- (void) _deactivate: (NSNotification*)notification
{
if (menu_is_visible)
[aWindow orderOut:nil];
}
- (void)_showTornOffMenuIfAny: (NSNotification*)notification
{
@ -971,6 +950,14 @@ NSArray* array;
}
}
- (id) init
{
return [self initWithContentRect: NSZeroRect
styleMask: NSBorderlessWindowMask
backing: NSBackingStoreBuffered
defer: NO];
}
- (BOOL) canBecomeMainWindow
{
return NO;
@ -981,14 +968,6 @@ NSArray* array;
return NO;
}
- (void) initDefaults
{
[super initDefaults];
menu_exclude = YES; // Don't show in windows menu.
window_level = NSSubmenuWindowLevel;
is_released_when_closed = NO;
}
- (BOOL) worksWhenModal
{
return YES;