fix: quit properly in simpleFullScreen mode (#14620)
This commit is contained in:
parent
a45ded5508
commit
12a435273d
1 changed files with 12 additions and 2 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue