Skip to content

fix: disable kWindowCaptureMacV2 for desktop capturer - #30507

Merged
VerteDinde merged 1 commit into
mainfrom
29458-mac-desktop-capture-id
Aug 13, 2021
Merged

VerteDinde merged 1 commit into
mainfrom
29458-mac-desktop-capture-id

Conversation

@VerteDinde

@VerteDinde VerteDinde commented Aug 11, 2021 •

Copy link
Copy Markdown
Member

Description of Change

Fixes #29458

When trying to screen capture an Electron application's own window, the screen will show as blank. This is because when kWindowCaptureMacV2 is enabled, the latter portion of the DesktopMediaID is incorrectly replaced. For example: the DesktopMediaID is changed from window:626:0 (correct) to window:626:626 (incorrect). Passing the incorrect id into the desktop capture API results in the window not being found, and a blank or default-colored screen.

kWindowCaptureMacV2 is already disabled by default in upstream Chromium (see here: https://chromium-review.googlesource.com/c/chromium/src/+/3069272). This PR also disables the feature by default until the upstream fix is in main. It also adds a new desktop capture test to keep the issue from happening again.

Checklist

Release Notes

Notes: Fixed an issue on Mac where an application could not capture its own window using the desktop capture or getMediaSourceId APIs.

@VerteDinde VerteDinde added semver/patch backwards-compatible bug fixes target/13-x-y labels Aug 11, 2021
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Aug 11, 2021
@VerteDinde
VerteDinde force-pushed the 29458-mac-desktop-capture-id branch 2 times, most recently from f517d38 to 78797cf Compare August 11, 2021 23:40
@VerteDinde
VerteDinde force-pushed the 29458-mac-desktop-capture-id branch from 78797cf to 92b3da9 Compare August 12, 2021 02:13
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Aug 12, 2021
@VerteDinde
VerteDinde merged commit a11a234 into main Aug 13, 2021
@VerteDinde
VerteDinde deleted the 29458-mac-desktop-capture-id branch August 13, 2021 20:23
@release-clerk

release-clerk Bot commented Aug 13, 2021

Copy link
Copy Markdown

Release Notes Persisted

Fixed an issue on Mac where an application could not capture its own window using the desktop capture or getMediaSourceId APIs.

@trop

trop Bot commented Aug 13, 2021

Copy link
Copy Markdown
Contributor

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

@trop

trop Bot commented Aug 13, 2021

Copy link
Copy Markdown
Contributor

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

@trop trop Bot removed the target/14-x-y label Aug 13, 2021
@trop

trop Bot commented Aug 13, 2021

Copy link
Copy Markdown
Contributor

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

@bingery

bingery commented Nov 24, 2021

Copy link
Copy Markdown

is there any settings on linux, my linux electron app screenshot black screen, mac is ok

@codebytere codebytere mentioned this pull request Jan 25, 2023
3 of 4 tasks
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]: Black Video When getUserMedia with chromeMediaSourceId === window.getMediaSourceId()

3 participants