diff --git a/atom/browser/ui/cocoa/atom_ns_window.mm b/atom/browser/ui/cocoa/atom_ns_window.mm index 03ed762cf368..983c86012bb9 100644 --- a/atom/browser/ui/cocoa/atom_ns_window.mm +++ b/atom/browser/ui/cocoa/atom_ns_window.mm @@ -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 {