Skip to content

Commit

Permalink
fix: persist maximizable state when toggling fullscreen (#23019)
Browse files Browse the repository at this point in the history
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
trop[bot] and codebytere committed Apr 10, 2020
1 parent 7efa4cc commit 9984dd9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions shell/browser/ui/cocoa/atom_ns_window.mm
Expand Up @@ -185,11 +185,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 9984dd9

Please sign in to comment.