Skip to content

Commit

Permalink
fix: treat maxWidth/Height<=0 as unlimited
Browse files Browse the repository at this point in the history
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
  • Loading branch information
trop[bot] and nornagon committed Dec 1, 2022
1 parent f527b8a commit 146f8a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions shell/browser/native_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ void NativeWindow::InitFromOptions(const gin_helper::Dictionary& options) {
int max_width = max_size.width() > 0 ? max_size.width() : INT_MAX;
int max_height = max_size.height() > 0 ? max_size.height() : INT_MAX;
bool have_max_width = options.Get(options::kMaxWidth, &max_width);
if (have_max_width && max_width <= 0)
max_width = INT_MAX;
bool have_max_height = options.Get(options::kMaxHeight, &max_height);
if (have_max_height && max_height <= 0)
max_height = INT_MAX;

// By default the window has a default maximum size that prevents it
// from being resized larger than the screen, so we should only set this
Expand Down

0 comments on commit 146f8a9

Please sign in to comment.