Fix --hidden not working on Linux

This commit is contained in:
Yuya Ochiai
2017-08-09 22:09:41 +09:00
parent aad60e2d16
commit d5d912cbdb

View File

@@ -42,6 +42,11 @@ function createMainWindow(config, options) {
});
const mainWindow = new BrowserWindow(windowOptions);
const indexURL = global.isDev ? 'http://localhost:8080/browser/index.html' : `file://${app.getAppPath()}/browser/index.html`;
mainWindow.loadURL(indexURL);
// This section should be called after loadURL() #570
if (options.hideOnStartup) {
if (windowOptions.maximized) {
mainWindow.maximize();
@@ -59,9 +64,6 @@ function createMainWindow(config, options) {
webPreferences.nodeIntegration = false;
});
const indexURL = global.isDev ? 'http://localhost:8080/browser/index.html' : `file://${app.getAppPath()}/browser/index.html`;
mainWindow.loadURL(indexURL);
mainWindow.once('ready-to-show', () => {
if (process.platform !== 'darwin') {
mainWindow.show();