Fix for bug #16688, but needs more investigation/work

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22995 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-05-29 08:47:32 +00:00
parent d9bafd0291
commit 46be8e4caf
5 changed files with 23 additions and 4 deletions

View file

@ -1,3 +1,17 @@
2006-05-29 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSApplication.m: Revert last change which broke menu
key equivalents for off-screen windows.
* Source/NSOpenPanel.m: Fix handling CR key equivalent (bug #16688)
so that panel only takes action when it is active.
* Source/NSSavePanel.m: ditto
Fix done by disabling the ok button when the panel is not active,
but what about if other panels have similar bugs ... shouldn't there
be some automatic mechanism to stop buttons (but not menu items) from
responding to key equivalents when a window is not the key window?
* Source/NSButton.m: ([performKeyEquivalent:]) return NO if blocked
by a modal window as per macos-x documentation.
2006-05-29 00:58 Gregory John Casamento <greg_casamento@yahoo.com>
* Source/NSApplication.m: Correction for bug#16688.

View file

@ -1838,9 +1838,6 @@ See -runModalForWindow:
{
NSWindow *window = [window_list objectAtIndex: i];
if ([window isVisible] == NO)
continue;
if ([window performKeyEquivalent: theEvent] == YES)
break;
}

View file

@ -500,10 +500,15 @@ static id buttonCellClass = nil;
[NSControl-performClick:]
[NSEvent-charactersIgnoringModifiers] [NSEvent-modifierFlags]</p>
Does nothing and returns NO if the receiver is disabled or if it is
blocked by a modal window being run.
*/
- (BOOL) performKeyEquivalent: (NSEvent *)anEvent
{
if ([self isEnabled])
NSWindow *w = [self window];
if ([self isEnabled] && ([w worksWhenModal] || [NSApp modalWindow] == w))
{
NSString *key = [self keyEquivalent];

View file

@ -563,6 +563,7 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
}
[NSApp stopModalWithCode: NSOKButton];
[_okButton setEnabled: NO];
[self close];
}

View file

@ -1067,6 +1067,7 @@ selectCellWithString: (NSString*)title
{
ASSIGN(_directory, [_browser pathToColumn:[_browser lastColumn]]);
[NSApp stopModalWithCode: NSCancelButton];
[_okButton setEnabled: NO];
[self close];
}
@ -1179,6 +1180,7 @@ selectCellWithString: (NSString*)title
return;
[NSApp stopModalWithCode: NSOKButton];
[_okButton setEnabled: NO];
[self close];
}