-
Notifications
You must be signed in to change notification settings - Fork 15k
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
[Bug]: window transparency not respected (black background) on some systems with hardware acceleration enabled #40515
Comments
Someone in Discord said I need to provide a fiddle -- I'm not sure how helpful it is since I cannot reproduce it and neither can anyone on our team, but here is a fiddle: https://gist.github.com/Galkon/c5e195442696a324afa03d9c391e8893 For anyone on electron team, if you want me to test any potential fixes with affected users or want to work with them to get more info, I will happily assist in that. My Discord is @Galkon |
Update: Affected users have the issue resolved when hardware acceleration is disabled for the app. A less than ideal solution for our app, but doable on a per-user basis... Is this a chromium issue then? Not sure where to go from here 🤔 |
Hi, i am running into this on windows 10, even with hardware accel off and with dual screen setup. Happy to share and help debug this npm version Here's how set some of the properties and i tried a lot of ways to set the width and height to no avail. function createOverlayWindow() {
} app.disableHardwareAcceleration(); |
Update here; Detection of Transparency FailuresI used the I added color detection for So far out of a very large sample size, around 5% of all Windows users on electron will experience transparency failure. The vast majority of them are a true black screen ( TroubleshootingFor affected users, we have seen varying success rates with different attempts at resolving it.
For now, I am detecting this automatically and disabling the transparent window, but this means functionality of the app is disabled for 5% of our users, not ideal. Unsure how to proceed with this open issue. |
Hello, I just happen to run into very same problem with different WinAPI application (my own actually, Rust based with OpenGL renderer). It happen on my PC, and after googling a lot I found this page, so I wish to to share some of my insights:
Platform: nVidia GeForce / Win 11 <- both up to date |
Preflight Checklist
Electron Version
25, 26, 27
What operating system are you using?
Windows
Operating System Version
Windows 10, Windows 11
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
When setting these options on a new BrowserWindow, the window should always be transparent regardless of whether or not hardware acceleration is enabled:
Actual Behavior
For some reason, for some people, electron does not respect the transparency or a transparent background color (such as
#00000000
) and it has a black background when hardware acceleration is enabled.It appears the issue is resolved when disabling hardware acceleration. Similar to this issue it seems.
Testcase Gist URL
https://gist.github.com/Galkon/c5e195442696a324afa03d9c391e8893
Sample App
Additional Information
Context
Context: We are using electron for a screen overlay at Medal.tv. For everyone on our team, there are no issues with transparency. However, there are some users using our production app which have this issue.
In our app we are still using electron 22 for win 7/8/8.1 compatibility, but I have verified this problem still exists in 25, 26, and 27 (side note, 27 is plagued by this bug too).
Disabling hardware acceleration is a less-than-ideal solution because our app is video-based and you cannot disable it per-window, only for the entire app.
Debugging
I've created a sample app which currently can run 15 different test scenarios, all of which still produce a black window for affected users when it should be transparent.
The tests it runs include 15 variations of the following:
backgroundColor
set to#00000000
or not set (related issue here?)show: true
on BrowserWindow initializationthickFrame
backgroundMaterial
tonone
hasShadow
tofalse
setBackground('#00000000')
after initializationsetBounds
andsetContentSize
setAlwaysOnTop
after initializationSystem Specs
I've been able to grab some specs of users systems, but I cannot find any correlating factors. It has happened to users on Windows 10, Windows 11, users with a single monitor, users with multiple monitors.
os.release()
)Other Info
The text was updated successfully, but these errors were encountered: