From b38d83523e094b15ff48aa117a62e8a4c8cbb7d7 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 21 Feb 2022 11:39:40 +0100 Subject: [PATCH] fix: max window size defaults to 0 --- shell/browser/native_window.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell/browser/native_window.cc b/shell/browser/native_window.cc index 74ef7d1bf9e5e..04b4ee7622e92 100644 --- a/shell/browser/native_window.cc +++ b/shell/browser/native_window.cc @@ -166,8 +166,9 @@ void NativeWindow::InitFromOptions(const gin_helper::Dictionary& options) { options.Get(options::kMinWidth, &min_width); options.Get(options::kMinHeight, &min_height); size_constraints.set_minimum_size(gfx::Size(min_width, min_height)); - int max_width = size_constraints.GetMaximumSize().width(); - int max_height = size_constraints.GetMaximumSize().height(); + gfx::Size max_size = size_constraints.GetMaximumSize(); + int max_width = max_size.width() > 0 ? max_size.width() : INT_MAX; + int max_height = max_size.height() > 0 ? max_size.height() : INT_MAX; options.Get(options::kMaxWidth, &max_width); options.Get(options::kMaxHeight, &max_height); size_constraints.set_maximum_size(gfx::Size(max_width, max_height));