fix: transparency on child windows being lost (#31003)

* fix: transparency on child windows being lost

* fix crash

* fix a different crash

* fix more crash
This commit is contained in:
Jeremy Rose 2021-09-20 17:20:54 -07:00 committed by GitHub
parent 6dd33b75b2
commit 82da4b0090
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View file

@ -362,7 +362,11 @@ void BrowserWindow::Blur() {
void BrowserWindow::SetBackgroundColor(const std::string& color_name) {
BaseWindow::SetBackgroundColor(color_name);
web_contents()->SetPageBaseBackgroundColor(ParseHexColor(color_name));
SkColor color = ParseHexColor(color_name);
web_contents()->SetPageBaseBackgroundColor(color);
auto* rwhv = web_contents()->GetRenderWidgetHostView();
if (rwhv)
rwhv->SetBackgroundColor(color);
// Also update the web preferences object otherwise the view will be reset on
// the next load URL call
if (api_web_contents_) {