From 074ac051d23977512b2103b08efcdc183828010f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 15 May 2014 15:19:02 +0800 Subject: [PATCH] mac: Respect use-content-size when creating window. --- atom/browser/native_window_mac.mm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 2b73fb8c100c..fb1e99566b6e 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -6,18 +6,18 @@ #include +#import "atom/browser/ui/cocoa/event_processing_window.h" +#include "atom/common/draggable_region.h" +#include "atom/common/options_switches.h" #include "base/mac/mac_util.h" #include "base/strings/sys_string_conversions.h" #include "base/values.h" -#import "atom/browser/ui/cocoa/event_processing_window.h" -#include "brightray/browser/inspectable_web_contents.h" -#include "brightray/browser/inspectable_web_contents_view.h" -#include "atom/common/draggable_region.h" -#include "atom/common/options_switches.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" #include "content/public/browser/render_view_host.h" +#include "vendor/brightray/browser/inspectable_web_contents.h" +#include "vendor/brightray/browser/inspectable_web_contents_view.h" static const CGFloat kAtomWindowCornerRadius = 4.0; @@ -179,6 +179,12 @@ NativeWindowMac::NativeWindowMac(content::WebContents* web_contents, // We will manage window's lifetime ourselves. [window_ setReleasedWhenClosed:NO]; + // On OS X the initial window size doesn't include window frame. + bool use_content_size = false; + options->GetBoolean(switches::kUseContentSize, &use_content_size); + if (has_frame_ && !use_content_size) + SetSize(gfx::Size(width, height)); + // Enable the NSView to accept first mouse event. bool acceptsFirstMouse = false; options->GetBoolean(switches::kAcceptFirstMouse, &acceptsFirstMouse);