Only allow main menu to become key and try to find another one.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14958 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2002-11-08 16:39:41 +00:00
parent ff1ecefed7
commit 1822484c60
5 changed files with 39 additions and 10 deletions

View file

@ -1,3 +1,13 @@
2002-11-08 Adam Fedor <fedor@gnu.org>
* Source/NSSavePanel.m ([NSSavePanel -_shouldShowExtension:isDir:]):
Filter regular files also.
* Source/NSMenu.m ([NSMenuPanel -canBecomeKeyWindow]): Return
YES only if we are the main menu.
* Source/NSWindow.m ([NSWindow -sendEvent:]) (FocusIn): If we are
the main menu, try to find another window to become key.
2002-11-07 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSCell.m

View file

@ -63,6 +63,14 @@
it is). Default is <code>Control-q</code>.
</p>
</desc>
<term>GSFileBrowserHideDotFiles</term>
<desc>
<p>
A boolean, by default NO. If you set it to YES, files that
begin with a dot ('.') are not shown in the NSSavePanel or
NSOpenPanel.
</p>
</desc>
<term>GSInsertControlKeystrokes</term>
<desc>
<p>

View file

@ -91,10 +91,10 @@ static NSNotificationCenter *nc;
@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;
/* See [NSWindow-_lossOfKeyOrMainWindow] */
if (self == (NSMenuPanel *)[[NSApp mainMenu] window])
return YES;
return NO;
}
@end

View file

@ -458,8 +458,16 @@ selectCellWithString: (NSString*)title
- (BOOL) _shouldShowExtension: (NSString *)extension
isDir: (BOOL *)isDir;
{
if (_treatsFilePackagesAsDirectories == NO && *isDir == YES &&
![extension isEqualToString: @""])
if (*isDir == NO)
{
if ([extension isEqualToString: _requiredFileType] == NO)
return NO;
}
else if ([extension length] == 0)
{
/* Automatic YES */
}
else if (_treatsFilePackagesAsDirectories == NO)
{
if ([extension isEqualToString: _requiredFileType] == YES)
*isDir = NO;

View file

@ -106,10 +106,6 @@ BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo);
non-obvious window that can become key) unless we have no choice
(i.e. all the candidate windows were ordered out.)
FIXME: It should be the appicon which can become key, not the main
menu, but there is currently an unsolved problem with WindowMaker
interaction that prevents me from doing this.
FIXME: It would really be better if we maintained a stack of the
most recent key/main windows and went through in order of most
recent to least recent. That's probably a lot of work, however.
@ -3018,6 +3014,13 @@ Code shared with [NSPanel -sendEvent:], remember to update both places.
[self makeMainWindow];
[NSApp activateIgnoringOtherApps: YES];
}
if (self == [[NSApp mainMenu] window])
{
/* We should really find another window that can become
key (if possible)
*/
[self _lossOfKeyOrMainWindow];
}
break;
case GSAppKitWindowFocusOut: