Merge pull request #3 from TheBrokenRail/patch-1

Implement setIsVisible
This commit is contained in:
Andrew Hyatt 2020-01-07 22:34:13 -05:00 committed by GitHub
commit 02a36f5f83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;