mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-11-26 02:40:24 -06:00
Merge pull request #829 from johankwarnmarksymphony/sda-1610-2
fix: Don't search for the main window use this.mainWindow, use getDisplayM…
This commit is contained in:
commit
0ccf690ba6
@ -435,14 +435,8 @@ export class WindowHandler {
|
|||||||
* Move window to the same screen as main window
|
* Move window to the same screen as main window
|
||||||
*/
|
*/
|
||||||
public moveWindow(windowToMove: BrowserWindow) {
|
public moveWindow(windowToMove: BrowserWindow) {
|
||||||
const allWindows = BrowserWindow.getAllWindows();
|
if (this.mainWindow && windowExists(this.mainWindow)) {
|
||||||
|
const display = electron.screen.getDisplayMatching(this.mainWindow.getBounds());
|
||||||
const parentWindow = allWindows.find((window) => {
|
|
||||||
return (window as ICustomBrowserWindow).winName === 'main';
|
|
||||||
});
|
|
||||||
|
|
||||||
if (parentWindow && windowExists(parentWindow)) {
|
|
||||||
const display = electron.screen.getDisplayNearestPoint({x: parentWindow.getBounds().x, y: parentWindow.getBounds().y});
|
|
||||||
|
|
||||||
logger.info('window-handler: moveWindow, display: ' + JSON.stringify(display.workArea));
|
logger.info('window-handler: moveWindow, display: ' + JSON.stringify(display.workArea));
|
||||||
logger.info('window-handler: moveWindow, windowToMove: ' + JSON.stringify(windowToMove.getBounds()));
|
logger.info('window-handler: moveWindow, windowToMove: ' + JSON.stringify(windowToMove.getBounds()));
|
||||||
|
Loading…
Reference in New Issue
Block a user