fix: don't unmaximize on macOS if user set max bounds (#33480)

This commit is contained in:
Shelley Vohr 2022-03-31 00:29:02 +02:00 committed by GitHub
parent afe0116d59
commit 8c8642634d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 1 deletions

View file

@ -3634,6 +3634,22 @@ describe('BrowserWindow module', () => {
expectBoundsEqual(w.getSize(), initialSize);
expectBoundsEqual(w.getPosition(), initialPosition);
});
ifit(process.platform === 'darwin')('should not change size or position of a window which is functionally maximized', async () => {
const { workArea } = screen.getPrimaryDisplay();
const bounds = {
x: workArea.x,
y: workArea.y,
width: workArea.width,
height: workArea.height
};
const w = new BrowserWindow(bounds);
w.unmaximize();
await delay(1000);
expectBoundsEqual(w.getBounds(), bounds);
});
});
describe('setFullScreen(false)', () => {