Merge pull request #192 from aaronraimist/close-fullscreen-macos

Prevent black screen when closing window while in full screen mode on macOS
This commit is contained in:
J. Ryan Stinnett
2021-05-05 16:54:48 +01:00
committed by GitHub

View File

@@ -955,7 +955,15 @@ app.on('ready', async () => {
// (this is generally how single-window Mac apps
// behave, eg. Mail.app)
e.preventDefault();
mainWindow.hide();
if (mainWindow.isFullScreen()) {
mainWindow.once('leave-full-screen', () => mainWindow.hide());
mainWindow.setFullScreen(false);
} else {
mainWindow.hide();
}
return false;
}
});