From dd43e92186c4f33da6118f462fe8b363a095d725 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 9 Oct 2018 20:37:07 -0700 Subject: [PATCH] fix: simplify SetBackgroundColor The compositor_superview member of BridgedNativeWidgetMac has been removed so as a consequence there is only one layer on which we need to call setBackgroundColor --- atom/browser/native_window_mac.mm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 907451024d4..401fcb25d3b 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -999,13 +999,7 @@ bool NativeWindowMac::IsKiosk() { void NativeWindowMac::SetBackgroundColor(SkColor color) { base::ScopedCFTypeRef cgcolor( skia::CGColorCreateFromSkColor(color)); - // views::Widget adds a layer for the content view. - auto* bridge = views::NativeWidgetMac::GetBridgeForNativeWindow(window_); - auto* compositor_superview = bridge->ns_view(); - [[compositor_superview layer] setBackgroundColor:cgcolor]; - // When using WebContents as content view, the contentView also has layer. - if ([[window_ contentView] wantsLayer]) - [[[window_ contentView] layer] setBackgroundColor:cgcolor]; + [[[window_ contentView] layer] setBackgroundColor:cgcolor]; } void NativeWindowMac::SetHasShadow(bool has_shadow) {