#54360: fix: restore non-resizable windows after desktopCapturer.getSources() on macOS
Description of Change
Fixes #44883.
After this change a resizable: false window on macOS stays non-resizable after desktopCapturer.getSources() runs.
On macOS 14.4+ ScreenCaptureKit flips a non-resizable window's style mask the first time it captures it. #43013 added a save-and-restore of resizable around the capture, but it stored each window under an array key (map.set([win.id], ...)) and looked it up by number, so the restore never ran.
The map is now keyed by window id and the restore iterates BaseWindow.getAllWindows() so bare BaseWindows are covered too. Reproduced on macOS 26.7 with 44.4.5: resizable reads true after getSources() and the edge drags; restoring it once after the capture holds for the rest of the session.
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
- tests are changed or added
Release Notes
Notes: Fixed desktopCapturer.getSources() leaving non-resizable windows resizable on macOS.
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron