From 9d30ffbbb3c0075518ce9b15655fb282309e57ef Mon Sep 17 00:00:00 2001 From: Gellert Hegyi Date: Sun, 26 Dec 2021 13:57:18 +0100 Subject: [PATCH 1/3] fix(window): setAspectRatio for frameless windows --- shell/browser/native_window_mac.mm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index a8e7194028d51..dec78d307acd6 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -1603,10 +1603,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, From 1498c72c35cac066fbad9cf6da6125024a73b03f Mon Sep 17 00:00:00 2001 From: Jeremy Rose Date: Mon, 10 Jan 2022 16:48:36 -0800 Subject: [PATCH 2/3] dummy --- shell/browser/native_window_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index dec78d307acd6..19d5d47ebceaa 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2013 GitHub, Inc. +// Copyright (c) 2013 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. From 6a2dcdfe7f6892ffef974812021c74d48c6fb0ea Mon Sep 17 00:00:00 2001 From: Jeremy Rose Date: Mon, 10 Jan 2022 16:48:47 -0800 Subject: [PATCH 3/3] undo dummy --- shell/browser/native_window_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 19d5d47ebceaa..dec78d307acd6 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2013 GitHub, Inc. +// Copyright (c) 2013 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file.