From c17fdc23a4780ef9be590c370511ef526cebd643 Mon Sep 17 00:00:00 2001 From: Dean Whillier Date: Wed, 20 Mar 2019 16:41:03 -0400 Subject: [PATCH] fix black screen when closing window in fullscreen --- src/main/mainWindow.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/mainWindow.js b/src/main/mainWindow.js index ac331bf7..d752f495 100644 --- a/src/main/mainWindow.js +++ b/src/main/mainWindow.js @@ -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: }