fix: quit properly in simpleFullScreen mode (#14671)

This commit is contained in:
Shelley Vohr
2018-09-19 08:31:08 -07:00
committed by GitHub
parent ac400e5cb9
commit d70942190c

View File

@@ -728,10 +728,20 @@ enum {
// Custom window button methods
- (BOOL)windowShouldClose:(id)sender { return YES; }
- (void)performClose:(id)sender {
if (shell_->title_bar_style() == atom::NativeWindowMac::CUSTOM_BUTTONS_ON_HOVER)
if (shell_->title_bar_style() ==
atom::NativeWindowMac::CUSTOM_BUTTONS_ON_HOVER) {
[[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];
}