From 9403804128e2e995b50ceebfa7a078084b21bded Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Wed, 19 Jan 2022 22:11:49 +0200 Subject: [PATCH] fix multiple monitor calculations --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 6a3f8578..07e1d669 100644 --- a/index.js +++ b/index.js @@ -127,8 +127,8 @@ function createMainWindow() { const { x, y } = windowPosition; const winSize = win.getSize(); const displaySize = electron.screen.getDisplayNearestPoint(windowPosition).bounds; - if((x + winSize[0] < -8 || x - winSize[0] > displaySize.width) || - (y < -8 || y > displaySize.height)) { + if((x + winSize[0] < displaySize.x - 8 || x - winSize[0] > displaySize.x + displaySize.width) || + (y < displaySize.y - 8 || y > displaySize.y + displaySize.height)) { //Window is offscreen if (is.dev()) { console.log(`Window tried to render offscreen, windowSize=${winSize}, displaySize=${displaySize}, position=${windowPosition}`);