From f8fadcb8446001bf9b303bf086b4ac01d7fd7e8d Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Wed, 28 Dec 2016 00:26:16 +0900 Subject: [PATCH] Show mainWindow gracefully http://electron.atom.io/docs/api/browser-window#showing-window-gracefully --- CHANGELOG.md | 3 +++ src/main.js | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92e3310c..fb05fe4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ Release date: TBD ### Improvements +#### All Platforms +- Suppress white screen which is displayed for a moment on startup + ### Bug Fixes #### All Platforms diff --git a/src/main.js b/src/main.js index 33c36a85..344cf52f 100644 --- a/src/main.js +++ b/src/main.js @@ -447,8 +447,11 @@ app.on('ready', () => { if (process.platform === 'linux') { windowOptions.icon = path.resolve(assetsDir, 'appicon.png'); } - windowOptions.title = app.getName(); + Object.assign(windowOptions, {title: app.getName(), show: false}); mainWindow = new BrowserWindow(windowOptions); + mainWindow.once('ready-to-show', () => { + mainWindow.show(); + }); if (process.platform === 'darwin') { session.defaultSession.on('will-download', (event, item) => {