fix black screen when closing window in fullscreen

This commit is contained in:
Dean Whillier
2019-03-20 16:41:03 -04:00
parent 79e020ba43
commit c17fdc23a4

View File

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