Show mainWindow gracefully

http://electron.atom.io/docs/api/browser-window#showing-window-gracefully
This commit is contained in:
Yuya Ochiai
2016-12-28 00:26:16 +09:00
parent 92830b371c
commit f8fadcb844
2 changed files with 7 additions and 1 deletions

View File

@@ -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

View File

@@ -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) => {