]> khamidou — GitHub mirrors - electron.git/commitdiff
views: Set a default maximum window size.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 11 Aug 2014 12:36:53 +0000 (20:36 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 11 Aug 2014 12:36:53 +0000 (20:36 +0800)
It is required to make the window able to be resized larger than the
screen.

atom/browser/native_window_views.cc

index 821c17af26dbbacfa6b2af77ecb615f102f73e60..2b9b0bebd4fef34b550dcf77b3b6557666f5ce1e 100644 (file)
@@ -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_);