fix: quit properly in simpleFullScreen mode (#14620)

This commit is contained in:
Shelley Vohr 2018-09-16 22:22:09 -07:00 committed by GitHub
parent a45ded5508
commit 12a435273d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -224,12 +224,22 @@ bool ScopedDisableResize::disable_resize_ = false;
// Custom window button methods // Custom window button methods
- (BOOL)windowShouldClose:(id)sender { return YES; }
- (void)performClose:(id)sender { - (void)performClose:(id)sender {
if (shell_->title_bar_style() == if (shell_->title_bar_style() ==
atom::NativeWindowMac::CUSTOM_BUTTONS_ON_HOVER) atom::NativeWindowMac::CUSTOM_BUTTONS_ON_HOVER) {
[[self delegate] windowShouldClose:self]; [[self delegate] windowShouldClose:self];
else } else if (shell_->IsSimpleFullScreen()) {
if([[self delegate] respondsToSelector:@selector(windowShouldClose:)]) {
if(![[self delegate] windowShouldClose:self]) return;
} else if([self respondsToSelector:@selector(windowShouldClose:)]) {
if(![self windowShouldClose:self]) return;
}
[self close];
} else {
[super performClose:sender]; [super performClose:sender];
}
} }
- (void)toggleFullScreenMode:(id)sender { - (void)toggleFullScreenMode:(id)sender {