codebytere

#54360: fix: restore non-resizable windows after desktopCapturer.getSources() on macOS

Merged
Created: Sep 25, 2026, 5:43:08 AM
Merged: Sep 25, 2026, 11:14:18 AM
4 comments
Target: main

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

Release Notes

Notes: Fixed desktopCapturer.getSources() leaving non-resizable windows resizable on macOS.

Backports

43-x-y
Merged
PR Number
#54396
Merged At
Sep 25, 2026, 1:31:05 PM
Released In
Not yet
Release Date
Not yet
44-x-y
Merged
PR Number
#54397
Merged At
Sep 25, 2026, 2:24:15 PM
Released In
Not yet
Release Date
Not yet
45-x-y
Merged
PR Number
#54398
Merged At
Sep 25, 2026, 2:17:19 PM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

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