Skip to content

Commit

Permalink
fix: persist maximizable state when toggling fullscreen (#22988)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Apr 8, 2020
1 parent b4447be commit a7469f8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions shell/browser/ui/cocoa/electron_ns_window.mm
Expand Up @@ -207,11 +207,17 @@ - (void)toggleFullScreenMode:(id)sender {

// If we're in simple fullscreen mode and trying to exit it
// we need to ensure we exit it properly to prevent a crash
// with NSWindowStyleMaskTitled mode
if (is_simple_fs || always_simple_fs)
// with NSWindowStyleMaskTitled mode.
if (is_simple_fs || always_simple_fs) {
shell_->SetSimpleFullScreen(!is_simple_fs);
else
} else {
bool maximizable = shell_->IsMaximizable();
[super toggleFullScreen:sender];

// Exiting fullscreen causes Cocoa to redraw the NSWindow, which resets
// the enabled state for NSWindowZoomButton. We need to persist it.
shell_->SetMaximizable(maximizable);
}
}

- (void)performMiniaturize:(id)sender {
Expand Down

0 comments on commit a7469f8

Please sign in to comment.