Implement -[NSWindow setIsVisible:]

This commit is contained in:
TheBrokenRail 2020-01-05 12:23:26 -05:00 committed by TheBrokenRail
parent 2e09764d1f
commit a8cc09eba4
2 changed files with 22 additions and 8 deletions

View File

@ -2350,18 +2350,29 @@ static BOOL _allowsAutomaticWindowTabbing;
}
-(void)makeKeyAndOrderFront:sender {
if ([self isMiniaturized])
[_platformWindow deminiaturize];
if ([self isMiniaturized])
[_platformWindow deminiaturize];
// Order window before making it key, per doc.s and behavior
// Order window before making it key, per doc.s and behavior
[self orderWindow:NSWindowAbove relativeTo:0];
[self orderWindow:NSWindowAbove relativeTo:0];
if([self canBecomeKeyWindow])
[self makeKeyWindow];
if ([self canBecomeKeyWindow])
[self makeKeyWindow];
if([self canBecomeMainWindow])
[self makeMainWindow];
if ([self canBecomeMainWindow])
[self makeMainWindow];
}
-(void)setIsVisible:(BOOL)visible {
if (_isVisible == visible)
return;
_isVisible = visible;
if (visible) {
[_platformWindow showWindowWithoutActivation];
} else {
[_platformWindow hideWindow];
}
}
-(void)orderFront:sender {

View File

@ -247,6 +247,9 @@ static NSData *makeWindowIcon() {
}
}
-(void)showWindowWithoutActivation {
[self ensureMapped];
}
-(void)setDelegate:delegate {
_delegate=delegate;