From 418ef3d3ac6255d5d475a68c01e44225cca80075 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 cc166a0e73353bcccba3af5e37d2843470da0904 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 2a25462643793697d78cf82477dff20596c2d6ba 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.