New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: BrowserWindow backgroundColor #30777
fix: BrowserWindow backgroundColor #30777
Conversation
Release Notes Persisted
|
I have automatically backported this PR to "14-x-y", please check out #30819 |
@codebytere will you backported this PR to "13-x-y"? BrowserView can also be fixed? |
Can this be backported? |
// explicitly set by calling | ||
// RenderWidgetHostOwnerDelegate::SetBackgroundOpaque(false). | ||
// RenderWidgetHostViewBase::SetBackgroundColor() will do this for us. | ||
if (web_preferences->IsEnabled(options::kTransparent)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is undocumented.
Ref: #16212 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this available on 16 already? If so still not fixing the intermittent loss of transparency there. |
Description of Change
fixes #30759
The renderer in Blink now sets its own background color which is determined from the logic in
WebViewImpl::BaseBackgroundColor()
.To set this background color for the main frame, we must use
WebContents::SetPageBaseBackgroundColor(SkColor)
.In #30136, we had reverted using this API because it ended up breaking BrowserWindow transparency. To get this to work, we can see from
WebViewImpl::BaseBackgroundColor()
that there's a property to enable transparency,override_base_background_color_to_transparent_
.To override the base background color to be transparent, we must call
RenderWidgetHostOwnerDelegate::SetBackgroundOpaque(false)
which we can do by invokingRenderWidgetHostViewBase::SetBackgroundColor(SK_ColorTRANSPARENT)
.cc @codebytere
Transparent window using https://gist.github.com/b52f026c763057f97f745fade82758fd from #30136
Background color using https://gist.github.com/4256f388d41ef0d974645a11ab72b1fe from #30759
Checklist
npm test
passesRelease Notes
Notes: Fixed BrowserWindow's backgroundColor option not having an effect.