mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-01-15 19:22:13 -06:00
Merge branch 'master' of github.com:symphonyoss/SymphonyElectron
This commit is contained in:
commit
0f39c6f4a9
@ -301,9 +301,12 @@ function setupFirstTimeLaunch() {
|
||||
* @returns {Promise}
|
||||
*/
|
||||
function setStartup(lStartup) {
|
||||
log.send(logLevels.INFO, `launch on startup parameter value is ${lStartup}`);
|
||||
return new Promise((resolve) => {
|
||||
let launchOnStartup = (lStartup === 'true');
|
||||
let launchOnStartup = (String(lStartup) === 'true');
|
||||
log.send(logLevels.INFO, `launchOnStartup value is ${launchOnStartup}`);
|
||||
if (launchOnStartup) {
|
||||
log.send(logLevels.INFO, `enabling launch on startup`);
|
||||
symphonyAutoLauncher.enable();
|
||||
return resolve();
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ function doCreateMainWindow(initialUrl, initialBounds) {
|
||||
|
||||
// if bounds if not fully contained in some display then use default size
|
||||
// and position.
|
||||
if (!isInDisplayBounds(bounds)) {
|
||||
if (!isInDisplayBounds(bounds) || initialBounds.isMaximized || initialBounds.isFullScreen) {
|
||||
bounds = null;
|
||||
}
|
||||
|
||||
@ -189,10 +189,22 @@ function doCreateMainWindow(initialUrl, initialBounds) {
|
||||
mainWindow = new BrowserWindow(newWinOpts);
|
||||
mainWindow.winName = 'main';
|
||||
|
||||
let throttledMainWinBoundsChange = throttle(5000, saveMainWinBounds);
|
||||
let throttledMainWinBoundsChange = throttle(1000, saveMainWinBounds);
|
||||
mainWindow.on('move', throttledMainWinBoundsChange);
|
||||
mainWindow.on('resize', throttledMainWinBoundsChange);
|
||||
|
||||
if (initialBounds && !isNodeEnv) {
|
||||
// maximizes the application if previously maximized
|
||||
if (initialBounds.isMaximized) {
|
||||
mainWindow.maximize();
|
||||
}
|
||||
|
||||
// Sets the application to full-screen if previously set to full-screen
|
||||
if (isMac && initialBounds.isFullScreen) {
|
||||
mainWindow.setFullScreen(true);
|
||||
}
|
||||
}
|
||||
|
||||
function retry() {
|
||||
if (!isOnline) {
|
||||
loadErrors.showNetworkConnectivityError(mainWindow, url, retry);
|
||||
@ -611,6 +623,12 @@ app.on('before-quit', function () {
|
||||
function saveMainWinBounds() {
|
||||
let newBounds = getWindowSizeAndPosition(mainWindow);
|
||||
|
||||
// set application full-screen and maximized state
|
||||
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||
newBounds.isMaximized = mainWindow.isMaximized();
|
||||
newBounds.isFullScreen = mainWindow.isFullScreen();
|
||||
}
|
||||
|
||||
if (newBounds) {
|
||||
updateConfigField('mainWinPos', newBounds);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user