Skip to content
This repository has been archived by the owner on Apr 22, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2621 from andia89/minimized
Browse files Browse the repository at this point in the history
Fixes start minimized
  • Loading branch information
fvulich authored Mar 20, 2020
2 parents 168eacb + 2185f32 commit 151caa0
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,10 @@ function createWindow () {

// Check if user has defined a custom User-Agent
if ( config.get('user_agent').length > 0 ) mainWindow.webContents.setUserAgent( config.get('user_agent') );

if ( !config.get('start_minimized') && config.get('maximized') ) mainWindow.maximize();
if ( config.get('window_display_behavior') !== 'show_trayIcon' && config.get('start_minimized') ) {
// Wait for the mainWindow.loadURL(..) and the optional mainWindow.webContents.openDevTools()
// to be finished before minimizing
mainWindow.webContents.once('did-finish-load', function(e) {
mainWindow.minimize();
});
}

// Wait for the mainWindow.loadURL(..) and the optional mainWindow.webContents.openDevTools()
// to be finished before minimizing
config.get('start_minimized') && mainWindow.webContents.once('did-finish-load', () => config.get('window_display_behavior') === 'show_trayIcon' ? mainWindow.hide() : mainWindow.minimize());

// Check if the window its outside of the view (ex: multi monitor setup)
const { positionOnScreen } = require('./utils/positionOnScreen');
Expand Down

0 comments on commit 151caa0

Please sign in to comment.