Window ordering/focus fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5506 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-12-14 16:53:23 +00:00
parent a61c6434b2
commit dde3060c43
2 changed files with 18 additions and 4 deletions

View file

@ -1,3 +1,10 @@
Tue Dec 14 16:51:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSWindow.m: ([-becomeKeyWindow]) Don't ask the backend to
make us key unless we are visible.
([-orderWindow:relativeTo:]) ask backned to make us key when we order
in (if we should be key that is).
Tue Dec 14 11:15:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk> Tue Dec 14 11:15:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Headers/AppKit/NSMenuitemCell.h: Removed implementation cache ivars * Headers/AppKit/NSMenuitemCell.h: Removed implementation cache ivars

View file

@ -549,7 +549,10 @@ static NSMapTable* windowmaps = NULL;
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
_f.is_key = YES; _f.is_key = YES;
DPSsetinputfocus(GSCurrentContext(), [self windowNumber]); if ([self isVisible] == YES)
{
DPSsetinputfocus(GSCurrentContext(), [self windowNumber]);
}
[self resetCursorRects]; [self resetCursorRects];
[nc postNotificationName: NSWindowDidBecomeKeyNotification object: self]; [nc postNotificationName: NSWindowDidBecomeKeyNotification object: self];
} }
@ -608,13 +611,13 @@ static NSMapTable* windowmaps = NULL;
- (void) makeKeyAndOrderFront: (id)sender - (void) makeKeyAndOrderFront: (id)sender
{ {
[self orderFront: sender];
[self makeKeyWindow]; [self makeKeyWindow];
/* /*
* OPENSTEP makes a window the main window when it makes it the key window. * OPENSTEP makes a window the main window when it makes it the key window.
* So we do the same (though the documentation doesn't mention it). * So we do the same (though the documentation doesn't mention it).
*/ */
[self makeMainWindow]; [self makeMainWindow];
[self orderFront: sender];
} }
- (void) makeKeyWindow - (void) makeKeyWindow
@ -738,7 +741,8 @@ static NSMapTable* windowmaps = NULL;
} }
} }
} }
else DPSorderwindow(GSCurrentContext(), place, otherWin, [self windowNumber]);
if (place != NSWindowOut)
{ {
if (_rFlags.needs_display == NO) if (_rFlags.needs_display == NO)
{ {
@ -770,8 +774,11 @@ static NSMapTable* windowmaps = NULL;
filename: isFileName]; filename: isFileName];
} }
} }
if ([self isKeyWindow] == YES)
{
DPSsetinputfocus(GSCurrentContext(), [self windowNumber]);
}
} }
DPSorderwindow(GSCurrentContext(), place, otherWin, [self windowNumber]);
} }
- (void) resignKeyWindow - (void) resignKeyWindow