fix: desktopCapturer breaks BrowserWindow resizable on macOS (#43013)

* fix: desktopCapturer breaks BrowserWindow resizable on macOS

* test: oops fix showing
This commit is contained in:
Shelley Vohr 2024-07-25 11:17:37 +02:00 committed by GitHub
parent c2c079dc82
commit cfdcf48e1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 34 additions and 1 deletions

View file

@ -148,6 +148,20 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt
}
});
// Regression test - see https://github.com/electron/electron/issues/43002
it('does not affect window resizable state', async () => {
w.resizable = false;
const wShown = once(w, 'show');
w.show();
await wShown;
const sources = await desktopCapturer.getSources({ types: ['window', 'screen'] });
expect(sources).to.be.an('array').that.is.not.empty();
expect(w.resizable).to.be.false();
});
it('moveAbove should move the window at the requested place', async () => {
// DesktopCapturer.getSources() is guaranteed to return in the correct
// z-order from foreground to background.