fix: quit properly in simpleFullScreen mode (#14646)

This commit is contained in:
trop[bot] 2018-09-17 08:09:26 -07:00 committed by Shelley Vohr
parent 89148bcf8d
commit 96c47ef537

View file

@ -224,12 +224,22 @@ bool ScopedDisableResize::disable_resize_ = false;
// 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)
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];
}
}
- (void)toggleFullScreenMode:(id)sender {