fix: maximized window bounds when toggle setResizable (#40503)
This commit is contained in:
parent
2029224a84
commit
3340bc1bf9
5 changed files with 94 additions and 4 deletions
|
@ -5091,6 +5091,55 @@ describe('BrowserWindow module', () => {
|
|||
w.setContentSize(10, 10);
|
||||
expectBoundsEqual(w.getContentSize(), [10, 10]);
|
||||
});
|
||||
|
||||
ifit(process.platform === 'win32')('do not change window with frame bounds when maximized', () => {
|
||||
const w = new BrowserWindow({
|
||||
show: true,
|
||||
frame: true,
|
||||
thickFrame: true
|
||||
});
|
||||
expect(w.isResizable()).to.be.true('resizable');
|
||||
w.maximize();
|
||||
expect(w.isMaximized()).to.be.true('maximized');
|
||||
const bounds = w.getBounds();
|
||||
w.setResizable(false);
|
||||
expectBoundsEqual(w.getBounds(), bounds);
|
||||
w.setResizable(true);
|
||||
expectBoundsEqual(w.getBounds(), bounds);
|
||||
});
|
||||
|
||||
ifit(process.platform === 'win32')('do not change window without frame bounds when maximized', () => {
|
||||
const w = new BrowserWindow({
|
||||
show: true,
|
||||
frame: false,
|
||||
thickFrame: true
|
||||
});
|
||||
expect(w.isResizable()).to.be.true('resizable');
|
||||
w.maximize();
|
||||
expect(w.isMaximized()).to.be.true('maximized');
|
||||
const bounds = w.getBounds();
|
||||
w.setResizable(false);
|
||||
expectBoundsEqual(w.getBounds(), bounds);
|
||||
w.setResizable(true);
|
||||
expectBoundsEqual(w.getBounds(), bounds);
|
||||
});
|
||||
|
||||
ifit(process.platform === 'win32')('do not change window transparent without frame bounds when maximized', () => {
|
||||
const w = new BrowserWindow({
|
||||
show: true,
|
||||
frame: false,
|
||||
thickFrame: true,
|
||||
transparent: true
|
||||
});
|
||||
expect(w.isResizable()).to.be.true('resizable');
|
||||
w.maximize();
|
||||
expect(w.isMaximized()).to.be.true('maximized');
|
||||
const bounds = w.getBounds();
|
||||
w.setResizable(false);
|
||||
expectBoundsEqual(w.getBounds(), bounds);
|
||||
w.setResizable(true);
|
||||
expectBoundsEqual(w.getBounds(), bounds);
|
||||
});
|
||||
});
|
||||
|
||||
describe('loading main frame state', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue