From d1a93a51354ded0a8ff3484ed1b36fd55866d253 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 11 Aug 2014 20:36:53 +0800 Subject: [PATCH] views: Set a default maximum window size. It is required to make the window able to be resized larger than the screen. --- atom/browser/native_window_views.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 821c17af..2b9b0beb 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -114,7 +114,12 @@ NativeWindowViews::NativeWindowViews(content::WebContents* web_contents, menu_bar_alt_pressed_(false), keyboard_event_handler_(new views::UnhandledKeyboardEventHandler), use_content_size_(false), - resizable_(true) { + resizable_(true), + // We need to set a default maximum window size here otherwise Windows + // will not allow us to resize the window larger than scree. + // Setting directly to INT_MAX somehow doesn't work, so we just devide + // by 10, which should still be large enough. + maximum_size_(INT_MAX / 10, INT_MAX / 10) { options.Get(switches::kResizable, &resizable_); options.Get(switches::kTitle, &title_); options.Get(switches::kAutoHideMenuBar, &menu_bar_autohide_); -- 2.43.0