Skip to content

fix: desktopCapturer breaks BrowserWindow resizable on macOS - #43013

Merged
codebytere merged 2 commits into
mainfrom
fix-screencapture-resizable
Jul 25, 2024
Merged

codebytere merged 2 commits into
mainfrom
fix-screencapture-resizable

Conversation

@codebytere

@codebytere codebytere commented Jul 23, 2024 •

Copy link
Copy Markdown
Member

Description of Change

Closes #43002.

Fixes an issue where calling desktopCapturer.getSources on macOS running 14.4 or later would make non-resizable windows resizable. This was happening due to a ScreenCaptureKit bug that modified a window's styleMask the first time it captured a non-resizable window. Fix this by recording each window's resizable status and potentially restoring it after the capture is complete.

Checklist

Release Notes

Notes: Fixed an issue where calling desktopCapturer.getSources on macOS running 14.4 or later would make non-resizable windows resizable.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/31-x-y PR should also be added to the "31-x-y" branch. target/32-x-y PR should also be added to the "32-x-y" branch. labels Jul 23, 2024
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Jul 23, 2024

@VerteDinde VerteDinde left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, good find on finding a bug in SCK itself 😄

@codebytere
codebytere force-pushed the fix-screencapture-resizable branch from 95e5e0c to 7086ce4 Compare July 23, 2024 18:15
@codebytere
codebytere force-pushed the fix-screencapture-resizable branch from 7086ce4 to db6a23d Compare July 23, 2024 19:51
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Jul 24, 2024
@codebytere
codebytere merged commit cfdcf48 into main Jul 25, 2024
@codebytere
codebytere deleted the fix-screencapture-resizable branch July 25, 2024 09:17
@release-clerk

release-clerk Bot commented Jul 25, 2024

Copy link
Copy Markdown

Release Notes Persisted

Fixed an issue where calling desktopCapturer.getSources on macOS running 14.4 or later would make non-resizable windows resizable.

@trop

trop Bot commented Jul 25, 2024

Copy link
Copy Markdown
Contributor

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

@trop trop Bot added in-flight/31-x-y and removed target/31-x-y PR should also be added to the "31-x-y" branch. labels Jul 25, 2024
@trop

trop Bot commented Jul 25, 2024

Copy link
Copy Markdown
Contributor

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

@trop trop Bot added in-flight/32-x-y merged/32-x-y PR was merged to the "32-x-y" branch. merged/31-x-y PR was merged to the "31-x-y" branch. and removed target/32-x-y PR should also be added to the "32-x-y" branch. in-flight/32-x-y in-flight/31-x-y labels Jul 25, 2024
MarshallOfSound pushed a commit that referenced this pull request Sep 25, 2026
… on macOS (#54360)

The ScreenCaptureKit workaround from #43013 recorded each window's
resizable state under an array key and looked it up by number, so the
restore step never ran. Key the map by window id and cover BaseWindow.
MarshallOfSound pushed a commit that referenced this pull request Sep 25, 2026
… on macOS (#54396)

The ScreenCaptureKit workaround from #43013 recorded each window's
resizable state under an array key and looked it up by number, so the
restore step never ran. Key the map by window id and cover BaseWindow.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <[email protected]>
MarshallOfSound pushed a commit that referenced this pull request Sep 25, 2026
… on macOS (#54398)

The ScreenCaptureKit workaround from #43013 recorded each window's
resizable state under an array key and looked it up by number, so the
restore step never ran. Key the map by window id and cover BaseWindow.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <[email protected]>
MarshallOfSound pushed a commit that referenced this pull request Sep 25, 2026
… on macOS (#54397)

The ScreenCaptureKit workaround from #43013 recorded each window's
resizable state under an array key and looked it up by number, so the
restore step never ran. Key the map by window id and cover BaseWindow.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/31-x-y PR was merged to the "31-x-y" branch. merged/32-x-y PR was merged to the "32-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: On MacOS, desktopCapturer make window with resizeable:false resizeable

2 participants