fix: BrowserWindow backgroundColor (#30778)

* fix: BrowserWindow backgroundColor

* refactor: propagate transparency via backgroundColor
This commit is contained in:
Samuel Maddock 2021-09-06 03:59:09 -04:00 committed by GitHub
parent 26f981fa3e
commit 7379e5eb36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 27 additions and 22 deletions

View file

@ -748,7 +748,7 @@ WebContents::WebContents(v8::Isolate* isolate,
}
} else if (IsOffScreen()) {
bool transparent = false;
options.Get("transparent", &transparent);
options.Get(options::kTransparent, &transparent);
content::WebContents::CreateParams params(session->browser_context());
auto* view = new OffScreenWebContentsView(
@ -1373,8 +1373,8 @@ void WebContents::HandleNewRenderFrame(
// Set the background color of RenderWidgetHostView.
auto* web_preferences = WebContentsPreferences::From(web_contents());
if (web_preferences) {
std::string color_name;
rwhv->SetBackgroundColor(web_preferences->GetBackgroundColor());
web_contents()->SetPageBaseBackgroundColor(
web_preferences->GetBackgroundColor());
}
if (!background_throttling_)