Skip to content
Permalink
Browse files

fix(electron): exit fullscreen before closing

On mac, closing the main window when the app is in fullscreen mode
results in a black screen. To resolve this, ensure that we exit
fullscreen mode before hiding the app.

Fix #1893

See electron/electron#6033
  • Loading branch information...
mrfelton committed Mar 31, 2019
1 parent 9ccc88c commit 660729af5dfb975889669e93a7372dab5bbae391
Showing with 8 additions and 1 deletion.
  1. +8 −1 electron/main.js
@@ -338,7 +338,14 @@ app.on('ready', async () => {
mainLog.trace('mainWindow.close')
if (os.platform() === 'darwin' && !mainWindow.forceClose) {
event.preventDefault()
mainWindow.hide()
if (mainWindow.isFullScreen()) {
mainWindow.once('leave-full-screen', () => {
mainWindow.hide()
})
mainWindow.setFullScreen(false)
} else {
mainWindow.hide()
}
}
})

0 comments on commit 660729a

Please sign in to comment.
You can’t perform that action at this time.