Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: persist maximizable state when toggling fullscreen #23019

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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