fix: restoring X11 window should not remove previous maximize state (#37346)

This commit is contained in:
Cheng Zhao 2023-02-21 17:49:02 +09:00 committed by GitHub
parent ee966ad6ec
commit a92fd2aa05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 74 additions and 0 deletions

View file

@ -4025,6 +4025,24 @@ describe('BrowserWindow module', () => {
w.hide();
w.show();
});
// TODO(zcbenz):
// This test does not run on Linux CI. See:
// https://github.com/electron/electron/issues/28699
ifit(process.platform === 'linux' && !process.env.CI)('should bring a minimized maximized window back to maximized state', async () => {
const w = new BrowserWindow({});
const maximize = emittedOnce(w, 'maximize');
w.maximize();
await maximize;
const minimize = emittedOnce(w, 'minimize');
w.minimize();
await minimize;
expect(w.isMaximized()).to.equal(false);
const restore = emittedOnce(w, 'restore');
w.restore();
await restore;
expect(w.isMaximized()).to.equal(true);
});
});
// TODO(dsanders11): Enable once maximize event works on Linux again on CI