Merge pull request #953 from mattermost/MM-14172

[MM-14172] Fix black screen when closing window in fullscreen on a Mac
This commit is contained in:
Dean Whillier 2019-03-26 09:29:20 -04:00 committed by GitHub
commit c72c30144c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -110,7 +110,15 @@ function createMainWindow(config, options) {
}
break;
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;
default:
}