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: use setAspectRatio for frameless window on mac #32287

Merged
Merged
Changes from 1 commit
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
11 changes: 8 additions & 3 deletions shell/browser/native_window_mac.mm
Expand Up @@ -1600,10 +1600,15 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
NativeWindow::SetAspectRatio(aspect_ratio, extra_size);

// Reset the behaviour to default if aspect_ratio is set to 0 or less.
if (aspect_ratio > 0.0)
[window_ setContentAspectRatio:NSMakeSize(aspect_ratio, 1.0)];
else
if (aspect_ratio > 0.0) {
NSSize aspect_ratio_size = NSMakeSize(aspect_ratio, 1.0);
if (has_frame())
[window_ setContentAspectRatio:aspect_ratio_size];
else
[window_ setAspectRatio:aspect_ratio_size];
} else {
[window_ setResizeIncrements:NSMakeSize(1.0, 1.0)];
}
}

void NativeWindowMac::PreviewFile(const std::string& path,
Expand Down