[MM-18007] macOS app reopens closed window on Cmd+Tab (#1110)

This commit is contained in:
Hunter Lester 2020-01-23 03:09:22 -08:00 committed by Guillermo Vayá
parent 458c3b2797
commit cf097e624f
2 changed files with 16 additions and 2 deletions

View file

@ -146,11 +146,11 @@ function createMainWindow(config, options) {
// need to leave fullscreen first, then hide the window
if (mainWindow.isFullScreen()) {
mainWindow.once('leave-full-screen', () => {
hideWindow(mainWindow);
app.hide();
});
mainWindow.setFullScreen(false);
} else {
hideWindow(mainWindow);
app.hide();
}
break;
default:

View file

@ -34,6 +34,20 @@ describe('application', function desc() {
visible.should.be.true;
});
if (process.platform === 'darwin') {
it.skip('should show closed window with cmd+tab', async () => {
// Unable to utilize Command key press due to: https://bugs.chromium.org/p/chromedriver/issues/detail?id=3023#c2
await this.app.client.waitUntilWindowLoaded();
await this.app.client.keys(['Meta', 'w']);
let visible = await this.app.browserWindow.isVisible();
visible.should.be.false;
this.app.client.keys(['Meta', 'Tab']);
visible = await this.app.browserWindow.isVisible();
visible.should.be.true;
});
}
it.skip('should restore window bounds', async () => {
// bounds seems to be incorrectly calculated in some environments
// - Windows 10: OK