fix: BrowserWindow transparency not working (#30136)
This commit is contained in:
parent
063ac19712
commit
1bb689e6dd
1 changed files with 12 additions and 10 deletions
|
@ -914,16 +914,6 @@ void WebContents::InitWithWebContents(content::WebContents* web_contents,
|
||||||
inspectable_web_contents_ = std::make_unique<InspectableWebContents>(
|
inspectable_web_contents_ = std::make_unique<InspectableWebContents>(
|
||||||
web_contents, browser_context->prefs(), is_guest);
|
web_contents, browser_context->prefs(), is_guest);
|
||||||
inspectable_web_contents_->SetDelegate(this);
|
inspectable_web_contents_->SetDelegate(this);
|
||||||
|
|
||||||
if (web_preferences) {
|
|
||||||
std::string color_name;
|
|
||||||
if (web_preferences->GetPreference(options::kBackgroundColor,
|
|
||||||
&color_name)) {
|
|
||||||
web_contents->SetPageBaseBackgroundColor(ParseHexColor(color_name));
|
|
||||||
} else {
|
|
||||||
web_contents->SetPageBaseBackgroundColor(SK_ColorTRANSPARENT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebContents::~WebContents() {
|
WebContents::~WebContents() {
|
||||||
|
@ -1383,6 +1373,18 @@ void WebContents::HandleNewRenderFrame(
|
||||||
if (!rwhv)
|
if (!rwhv)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Set the background color of RenderWidgetHostView.
|
||||||
|
auto* web_preferences = WebContentsPreferences::From(web_contents());
|
||||||
|
if (web_preferences) {
|
||||||
|
std::string color_name;
|
||||||
|
if (web_preferences->GetPreference(options::kBackgroundColor,
|
||||||
|
&color_name)) {
|
||||||
|
rwhv->SetBackgroundColor(ParseHexColor(color_name));
|
||||||
|
} else {
|
||||||
|
rwhv->SetBackgroundColor(SK_ColorTRANSPARENT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!background_throttling_)
|
if (!background_throttling_)
|
||||||
render_frame_host->GetRenderViewHost()->SetSchedulerThrottling(false);
|
render_frame_host->GetRenderViewHost()->SetSchedulerThrottling(false);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue