sda-1720 windows/electron BrowserWindow does not always open a window with the right location and size

This commit is contained in:
Johan Kwarnmark 2020-01-31 11:06:47 +01:00
parent e9ec69ca5c
commit ce4a3968d8

View File

@ -152,6 +152,14 @@ export class WindowHandler {
...this.windowOpts, ...getBounds(this.config.mainWinPos, DEFAULT_WIDTH, DEFAULT_HEIGHT),
}) as ICustomBrowserWindow;
if (isWindowsOS) {
// SDA-1720 when Symphony on secondary screen is wider than main screen, the window on secondary is clapmed to the width of main screen
// Only happens on windows (BrowserWindow)
this.mainWindow.setBounds(getBounds(this.config.mainWinPos, DEFAULT_WIDTH, DEFAULT_HEIGHT) as Electron.Rectangle);
}
logger.info('window-handler: this.mainWindow.getBounds: ' + JSON.stringify(this.mainWindow.getBounds()));
this.mainWindow.winName = apiName.mainWindowName;
const {isFullScreen, isMaximized} = this.config.mainWinPos ? this.config.mainWinPos : {isFullScreen: false, isMaximized: false};
if (isMaximized) {