mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -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}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
function setStartup(lStartup) {
|
function setStartup(lStartup) {
|
||||||
|
log.send(logLevels.INFO, `launch on startup parameter value is ${lStartup}`);
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
let launchOnStartup = (lStartup === 'true');
|
let launchOnStartup = (String(lStartup) === 'true');
|
||||||
|
log.send(logLevels.INFO, `launchOnStartup value is ${launchOnStartup}`);
|
||||||
if (launchOnStartup) {
|
if (launchOnStartup) {
|
||||||
|
log.send(logLevels.INFO, `enabling launch on startup`);
|
||||||
symphonyAutoLauncher.enable();
|
symphonyAutoLauncher.enable();
|
||||||
return resolve();
|
return resolve();
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ function doCreateMainWindow(initialUrl, initialBounds) {
|
|||||||
|
|
||||||
// if bounds if not fully contained in some display then use default size
|
// if bounds if not fully contained in some display then use default size
|
||||||
// and position.
|
// and position.
|
||||||
if (!isInDisplayBounds(bounds)) {
|
if (!isInDisplayBounds(bounds) || initialBounds.isMaximized || initialBounds.isFullScreen) {
|
||||||
bounds = null;
|
bounds = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,10 +189,22 @@ function doCreateMainWindow(initialUrl, initialBounds) {
|
|||||||
mainWindow = new BrowserWindow(newWinOpts);
|
mainWindow = new BrowserWindow(newWinOpts);
|
||||||
mainWindow.winName = 'main';
|
mainWindow.winName = 'main';
|
||||||
|
|
||||||
let throttledMainWinBoundsChange = throttle(5000, saveMainWinBounds);
|
let throttledMainWinBoundsChange = throttle(1000, saveMainWinBounds);
|
||||||
mainWindow.on('move', throttledMainWinBoundsChange);
|
mainWindow.on('move', throttledMainWinBoundsChange);
|
||||||
mainWindow.on('resize', 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() {
|
function retry() {
|
||||||
if (!isOnline) {
|
if (!isOnline) {
|
||||||
loadErrors.showNetworkConnectivityError(mainWindow, url, retry);
|
loadErrors.showNetworkConnectivityError(mainWindow, url, retry);
|
||||||
@ -611,6 +623,12 @@ app.on('before-quit', function () {
|
|||||||
function saveMainWinBounds() {
|
function saveMainWinBounds() {
|
||||||
let newBounds = getWindowSizeAndPosition(mainWindow);
|
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) {
|
if (newBounds) {
|
||||||
updateConfigField('mainWinPos', newBounds);
|
updateConfigField('mainWinPos', newBounds);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user