From f94661547c2123f443638c9004b23940239b6058 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 3 Apr 2016 11:59:21 +0900 Subject: [PATCH] mac: backgroundColor should not change titlebar color --- atom/browser/native_window_mac.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index bb8bd938761..3c76cbe25a5 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -10,6 +10,7 @@ #include "atom/common/draggable_region.h" #include "atom/common/options_switches.h" #include "base/mac/mac_util.h" +#include "base/mac/scoped_cftyperef.h" #include "base/strings/sys_string_conversions.h" #include "brightray/browser/inspectable_web_contents.h" #include "brightray/browser/inspectable_web_contents_view.h" @@ -806,8 +807,9 @@ bool NativeWindowMac::IsKiosk() { } void NativeWindowMac::SetBackgroundColor(const std::string& color_name) { - SkColor color = ParseHexColor(color_name); - [window_ setBackgroundColor:skia::SkColorToCalibratedNSColor(color)]; + base::ScopedCFTypeRef color = + skia::CGColorCreateFromSkColor(ParseHexColor(color_name)); + [[[window_ contentView] layer] setBackgroundColor:color]; } void NativeWindowMac::SetHasShadow(bool has_shadow) {