From d685d27313d3835db65dd777668a6b73a8a7c21f 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 | 3 +++ .../patches/views_widget_180_1481_1677_1749.patch | 15 ++++++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index bc32b300c..7bdab99b8 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -836,8 +836,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 cd3244d3a..6c7e06791 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -65,6 +65,9 @@ patches = [ # # Support creation of captionless windows with resizable borders. # https://bitbucket.org/chromiumembedded/cef/issues/1749 + # + # Fix white flash during browser creation. + # https://bitbucket.org/chromiumembedded/cef/issues/1984 'name': 'views_widget_180_1481_1677_1749', 'path': '../', }, diff --git a/patch/patches/views_widget_180_1481_1677_1749.patch b/patch/patches/views_widget_180_1481_1677_1749.patch index bb0368a50..968dcd0a8 100644 --- a/patch/patches/views_widget_180_1481_1677_1749.patch +++ b/patch/patches/views_widget_180_1481_1677_1749.patch @@ -1,5 +1,5 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index 3992bb0..45d82fc 100644 +index 3992bb0..1c27354 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc @@ -769,6 +769,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() { @@ -16,6 +16,19 @@ index 3992bb0..45d82fc 100644 // TODO(wjmaclean): can host_ ever be null? if (host_ && set_focus_on_mouse_down_or_key_event_) { set_focus_on_mouse_down_or_key_event_ = false; +@@ -923,8 +930,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); ++ } + } + + gfx::Size RenderWidgetHostViewAura::GetVisibleViewportSize() const { diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc index 28b3698..337f35d 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc