Repository navigation
fix: apply setContentProtection() in Windows remote sessions again - #54492
Merged
Merged
Conversation
Chromium stopped excluding windows from capture in remote sessions so that its own Picture-in-Picture windows stay visible to the remote user (https://chromium-review.googlesource.com/c/chromium/src/+/7918332). The same code path backs setContentProtection(), so since Electron 44 the call has silently done nothing over Remote Desktop while isContentProtected() kept returning true. Enable the feature that lifts the restriction by default, and document the effect on remote users and how to opt out.
SetWindowDisplayAffinity is applied by the next DWM composition. Measured on Windows 11 24H2, the first frame without the window was presented 9-42ms after the call, and a capture started within about 11ms could still contain it.
MarshallOfSound
approved these changes
Sep 27, 2026
|
Release Notes Persisted
|
This was referenced Sep 28, 2026
Contributor
|
I have automatically backported this PR to "45-x-y", please check out #54499 |
Contributor
|
I have automatically backported this PR to "44-x-y", please check out #54500 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Since Electron 44,
win.setContentProtection(true)has done nothing when the app runs in a Windows remote session, whilewin.isContentProtected()kept returningtrue. Chromium stopped excluding windows from capture in remote sessions so that its own Picture-in-Picture windows stay visible to the remote user (https://chromium-review.googlesource.com/c/chromium/src/+/7918332), andsetContentProtection()goes through the same code path.This enables
AllowWindowCaptureExclusionInRemoteSessionsby default, so an explicit request for protection is honored again as it is on 43. Apps that would rather leave windows unprotected in remote sessions can pass the feature to--disable-features, which takes precedence. A second commit documents that the change takes effect with the next desktop composition.Measured on Windows 11 24H2 in a Remote Desktop session: 43.7.5 sets
WDA_EXCLUDEFROMCAPTURE, the window stays visible in themstscclient and is absent from a capture taken inside the session; 44.4.5 leavesWDA_NONEand the capture contains the window. 44.4.3 launched with--enable-features=AllowWindowCaptureExclusionInRemoteSessions, which is what this change makes the default, applies the exclusion again and the window is absent fromdesktopCapturer.getSources(). At the console all of them set it. There's no spec because CI can't switch a session between console and remote.Checklist
Release Notes
Notes: Fixed
setContentProtection(true)having no effect in Windows remote sessions.