From a3a375994573db7cb74861db4a1a5afc65181c8f 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 6dfba95f44e19..07d0999777c76 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -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, From a3af8f5774cd600cd02f8e5862da1e96e41627dd 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 07d0999777c76..aa8ac70090720 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 d3ef365ba29eff8fe741c8ecd51c1936a35f7694 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 aa8ac70090720..07d0999777c76 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.