[MM-18007] macOS app reopens closed window on Cmd+Tab (#1110)
This commit is contained in:

committed by
Guillermo Vayá

parent
458c3b2797
commit
cf097e624f
@@ -146,11 +146,11 @@ function createMainWindow(config, options) {
|
|||||||
// need to leave fullscreen first, then hide the window
|
// need to leave fullscreen first, then hide the window
|
||||||
if (mainWindow.isFullScreen()) {
|
if (mainWindow.isFullScreen()) {
|
||||||
mainWindow.once('leave-full-screen', () => {
|
mainWindow.once('leave-full-screen', () => {
|
||||||
hideWindow(mainWindow);
|
app.hide();
|
||||||
});
|
});
|
||||||
mainWindow.setFullScreen(false);
|
mainWindow.setFullScreen(false);
|
||||||
} else {
|
} else {
|
||||||
hideWindow(mainWindow);
|
app.hide();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@@ -34,6 +34,20 @@ describe('application', function desc() {
|
|||||||
visible.should.be.true;
|
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 () => {
|
it.skip('should restore window bounds', async () => {
|
||||||
// bounds seems to be incorrectly calculated in some environments
|
// bounds seems to be incorrectly calculated in some environments
|
||||||
// - Windows 10: OK
|
// - Windows 10: OK
|
||||||
|
Reference in New Issue
Block a user