macos: resign main/key when hiding window

This isn't done automatically for us, so we need to synthesize it in
our hide helper.

With this commit, we properly re-focus the new main/key window after
we have closed a transient-for window.
This commit is contained in:
Christian Hergert
2020-12-02 11:35:22 -08:00
parent 853a9c7a8c
commit b38d0d7d9e

View File

@@ -320,11 +320,20 @@
-(void)hide
{
BOOL wasKey = [self isKeyWindow];
BOOL wasMain = [self isMainWindow];
inShowOrHide = YES;
[self orderOut:nil];
inShowOrHide = NO;
initialPositionKnown = NO;
if (wasMain)
[self windowDidResignMain:nil];
if (wasKey)
[self windowDidResignKey:nil];
}
-(BOOL)trackManualMove