mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-28 09:51:06 -06:00
We can not just take for the stack of windows, we need to get the main window
This commit is contained in:
parent
81c552c51c
commit
d54ae4402c
@ -997,10 +997,7 @@ export class WindowHandler {
|
||||
const allDisplays = electron.screen.getAllDisplays();
|
||||
logger.info('window-handler, createSnippingToolWindow: User has these displays: ' + JSON.stringify(allDisplays));
|
||||
|
||||
const electronWindows = BrowserWindow.getAllWindows();
|
||||
const mainWindow = electronWindows[0];
|
||||
|
||||
if (!mainWindow) {
|
||||
if (!this.mainWindow) {
|
||||
logger.error('window-handler: Could not get main window');
|
||||
return;
|
||||
}
|
||||
@ -1012,7 +1009,7 @@ export class WindowHandler {
|
||||
const BUTTON_BAR_BOTTOM_HEIGHT = 72;
|
||||
const BUTTON_BARS_HEIGHT = BUTTON_BAR_TOP_HEIGHT + BUTTON_BAR_BOTTOM_HEIGHT;
|
||||
|
||||
const display = electron.screen.getDisplayMatching(mainWindow.getBounds());
|
||||
const display = electron.screen.getDisplayMatching(this.mainWindow.getBounds());
|
||||
const workAreaSize = display.workAreaSize;
|
||||
const maxToolHeight = Math.floor(calculatePercentage(workAreaSize.height, 90));
|
||||
const maxToolWidth = Math.floor(calculatePercentage(workAreaSize.width, 90));
|
||||
@ -1070,8 +1067,8 @@ export class WindowHandler {
|
||||
opts.alwaysOnTop = true;
|
||||
}
|
||||
|
||||
if (isWindowsOS && mainWindow) {
|
||||
opts.parent = mainWindow;
|
||||
if (isWindowsOS && this.mainWindow) {
|
||||
opts.parent = this.mainWindow;
|
||||
}
|
||||
|
||||
this.snippingToolWindow = createComponentWindow('snipping-tool', opts);
|
||||
|
Loading…
Reference in New Issue
Block a user