More focus fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14800 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 2002-10-20 01:48:55 +00:00
parent 6d3f7f9d38
commit feaf4828d5
7 changed files with 77 additions and 37 deletions

View file

@ -55,6 +55,10 @@
#include <AppKit/NSScreen.h>
#include <AppKit/NSAttributedString.h>
/* Subclass of NSPanel since menus cannot become key */
@interface NSMenuPanel : NSPanel
@end
/* A menu's title is an instance of this class */
@interface NSMenuWindowTitleView : NSView
{
@ -80,8 +84,18 @@ static NSString *NSMenuLocationsKey = @"NSMenuLocations";
static NSNotificationCenter *nc;
@interface NSMenu (GNUstepPrivate)
- (NSString*) _locationKey;
- (NSPanel*) _createWindow;
- (NSString *) _locationKey;
- (NSMenuPanel *) _createWindow;
@end
@implementation NSMenuPanel
- (BOOL) canBecomeKeyWindow
{
/* This should be NO, but there's currently a bug in the interaction
with WindowMaker that causes spurious deactivation of the app
if the app icon is the only window that can become key */
return YES;
}
@end
@implementation NSMenu (GNUstepPrivate)
@ -111,9 +125,9 @@ static NSNotificationCenter *nc;
}
/* Create a non autorelease window for this menu. */
- (NSPanel*) _createWindow
- (NSMenuPanel*) _createWindow
{
NSPanel *win = [[NSPanel alloc]
NSMenuPanel *win = [[NSMenuPanel alloc]
initWithContentRect: NSZeroRect
styleMask: NSBorderlessWindowMask
backing: NSBackingStoreBuffered