From ff7f70442fa86caa033de8d8417ab8bb9b6e3630 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 13 Jan 2017 16:35:26 -0500 Subject: [PATCH] Windows: Fix white flash during browser creation (issue #1984) --- libcef/browser/content_browser_client.cc | 3 +-- patch/patch.cfg | 6 ++++++ patch/patches/rwh_background_color_1984.patch | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 patch/patches/rwh_background_color_1984.patch diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index abd3b21db..171b8d594 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -858,8 +858,7 @@ void CefContentBrowserClient::OverrideWebkitPrefs( content::WebPreferences* prefs) { renderer_prefs::PopulateWebPreferences(rvh, *prefs); - if (rvh->GetWidget()->GetView() && - rvh->GetWidget()->GetView()->GetNativeView()) { + if (rvh->GetWidget()->GetView()) { rvh->GetWidget()->GetView()->SetBackgroundColor( prefs->base_background_color); } diff --git a/patch/patch.cfg b/patch/patch.cfg index 95b36b0b9..af4cb25d7 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -309,4 +309,10 @@ patches = [ 'name': 'crashpad_tp_1995', 'path': '../third_party/crashpad/', }, + { + # Fix white flash during browser creation. + # https://bitbucket.org/chromiumembedded/cef/issues/1984 + 'name': 'rwh_background_color_1984', + 'path': '../', + }, ] diff --git a/patch/patches/rwh_background_color_1984.patch b/patch/patches/rwh_background_color_1984.patch new file mode 100644 index 000000000..f1475e645 --- /dev/null +++ b/patch/patches/rwh_background_color_1984.patch @@ -0,0 +1,17 @@ +diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc +index 8a73ab8..11f2d54 100644 +--- content/browser/renderer_host/render_widget_host_view_aura.cc ++++ content/browser/renderer_host/render_widget_host_view_aura.cc +@@ -761,8 +761,10 @@ void RenderWidgetHostViewAura::SetBackgroundColor(SkColor color) { + RenderWidgetHostViewBase::SetBackgroundColor(color); + bool opaque = GetBackgroundOpaque(); + host_->SetBackgroundOpaque(opaque); +- window_->layer()->SetFillsBoundsOpaquely(opaque); +- window_->layer()->SetColor(color); ++ if (window_) { ++ window_->layer()->SetFillsBoundsOpaquely(opaque); ++ window_->layer()->SetColor(color); ++ } + } + + bool RenderWidgetHostViewAura::IsMouseLocked() {