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 Frith-MacDonald 1999-12-14 16:53:23 +00:00
parent 5ed8c1ec93
commit 442bb28f53
2 changed files with 18 additions and 4 deletions

View file

@ -549,7 +549,10 @@ static NSMapTable* windowmaps = NULL;
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
_f.is_key = YES;
DPSsetinputfocus(GSCurrentContext(), [self windowNumber]);
if ([self isVisible] == YES)
{
DPSsetinputfocus(GSCurrentContext(), [self windowNumber]);
}
[self resetCursorRects];
[nc postNotificationName: NSWindowDidBecomeKeyNotification object: self];
}
@ -608,13 +611,13 @@ static NSMapTable* windowmaps = NULL;
- (void) makeKeyAndOrderFront: (id)sender
{
[self orderFront: sender];
[self makeKeyWindow];
/*
* 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).
*/
[self makeMainWindow];
[self orderFront: sender];
}
- (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)
{
@ -770,8 +774,11 @@ static NSMapTable* windowmaps = NULL;
filename: isFileName];
}
}
if ([self isKeyWindow] == YES)
{
DPSsetinputfocus(GSCurrentContext(), [self windowNumber]);
}
}
DPSorderwindow(GSCurrentContext(), place, otherWin, [self windowNumber]);
}
- (void) resignKeyWindow