Skip to content

fix: BrowserWindow transparency not working#30136

Merged
codebytere merged 1 commit intomainfrom
macos-broken-transparency
Jul 15, 2021
Merged

fix: BrowserWindow transparency not working#30136
codebytere merged 1 commit intomainfrom
macos-broken-transparency

Conversation

@codebytere
Copy link
Copy Markdown
Member

@codebytere codebytere commented Jul 14, 2021

Description of Change

Closes #30082.

Fixes an issue where BrowserWindows would not properly honor transparency: true or a backgroundColor being set in their constructor options. This happened as a result of this CL rolled into Electron via #29751. The new method SetPageBaseBackgroundColor set the default content background color - i.e, the color that would appear behind the content unless the content overrode it. What then happened was that when we changed our logic to call this method, it was eventually overridden by Blink, and so would show as transparent or with the supplied color for a flash and then revert to white. We fix this by directly calling the background color method in RenderWidgetHostViewBase.

Tested with https://gist.github.com/b52f026c763057f97f745fade82758fd.

Checklist

Release Notes

Notes: Fixed an issue where BrowserWindows would not properly honor transparency: true or a backgroundColor being set in their constructor options.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/14-x-y labels Jul 14, 2021
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Jul 14, 2021
Copy link
Copy Markdown
Contributor

@nornagon nornagon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to break fairly frequently... is there some way we could test this? With desktopCapturer perhaps? 😬

@codebytere codebytere force-pushed the macos-broken-transparency branch from 103ca40 to 6a67c62 Compare July 14, 2021 16:47
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Jul 15, 2021
@codebytere
Copy link
Copy Markdown
Member Author

Failure not germane.

@codebytere codebytere merged commit 1bb689e into main Jul 15, 2021
@codebytere codebytere deleted the macos-broken-transparency branch July 15, 2021 20:18
@release-clerk
Copy link
Copy Markdown

release-clerk bot commented Jul 15, 2021

Release Notes Persisted

Fixed an issue where BrowserWindows would not properly honor transparency: true or a backgroundColor being set in their constructor options.

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Jul 15, 2021

I have automatically backported this PR to "14-x-y", please check out #30159

@gr0uch
Copy link
Copy Markdown

gr0uch commented Aug 3, 2021

This appears to still be broken in latest v14 beta and v15 alpha versions :(

Works on current v13 stable though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Transparency/backgroundColor no longer working

7 participants