fix: calculate frame when setting window placement (#25014)

This commit is contained in:
Cheng Zhao 2020-08-20 04:34:15 +09:00 committed by GitHub
parent 9021843850
commit 52d7afa4ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 8 deletions

View file

@ -1005,6 +1005,26 @@ describe('BrowserWindow module', () => {
await restore;
expectBoundsEqual(w.getNormalBounds(), bounds);
});
it('does not change size for a frameless window with min size', async () => {
w.destroy();
w = new BrowserWindow({
show: false,
frame: false,
width: 300,
height: 300,
minWidth: 300,
minHeight: 300
});
const bounds = w.getBounds();
w.once('minimize', () => {
w.restore();
});
const restore = emittedOnce(w, 'restore');
w.show();
w.minimize();
await restore;
expectBoundsEqual(w.getNormalBounds(), bounds);
});
});
ifdescribe(process.platform === 'win32')('Fullscreen state', () => {