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: black window on screen capture when content protection is enabled #31340
Conversation
Release Notes Persisted
|
I have automatically backported this PR to "15-x-y", please check out #31385 |
I have automatically backported this PR to "16-x-y", please check out #31386 |
/trop run backports |
/trop run backport |
The backport process for this PR has been manually initiated - here we go! :D |
I have automatically backported this PR to "13-x-y", please check out #31550 |
I have automatically backported this PR to "14-x-y", please check out #31551 |
electron#31340) Co-authored-by: Micha Hanselmann <mhanselmann@microsoft.com>
electron#31340) Co-authored-by: Micha Hanselmann <mhanselmann@microsoft.com>
electron#31340) Co-authored-by: Micha Hanselmann <mhanselmann@microsoft.com>
electron#31340) Co-authored-by: Micha Hanselmann <mhanselmann@microsoft.com>
electron#31340) Co-authored-by: Micha Hanselmann <mhanselmann@microsoft.com>
electron#31340) Co-authored-by: Micha Hanselmann <mhanselmann@microsoft.com>
Description of Change
Closes #29085.
When screen sharing, BrowserWindows with enabled content protection should be transparent on supported Win 10 versions. However, after hiding and showing the window, Windows falls back to a black rectangle as known from the old
WDA_MONITOR
affinity (thoughGetWindowDisplayAffinity
still returnsWDA_EXCLUDEFROMCAPTURE
). This workaround mitigates the issue by setting theWS_EX_LAYERED
flag on the window.Please backport to v15 & v16.
Repro fiddle: https://gist.github.com/012544e8dbde6143d809dd82b201b236
Repro steps: run -> aux window will be hidden; press hide & show -> black/transparent rect
cc @codebytere @miniak @zarubond
Checklist
npm test
passesRelease Notes
Notes: Fixed black window when screen capturing a content-protected BrowserWindow on Windows 10.