From c8d516c40b80a7dff8165ae1eafc24083654923a Mon Sep 17 00:00:00 2001 From: lawr <15603444+Alawnely@users.noreply.github.com> Date: Thu, 1 Aug 2024 18:27:01 +0800 Subject: [PATCH] fix: Window gets stuck offscreen in some instances (#2303) Improved offscreen detection logic, fixes th-ch#1894 --- src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 659c27e4..15019c91 100644 --- a/src/index.ts +++ b/src/index.ts @@ -331,10 +331,10 @@ async function createMainWindow() { const scaledY = windowY; if ( - scaledX + scaledWidth < display.bounds.x - 8 || - scaledX - scaledWidth > display.bounds.x + display.bounds.width || - scaledY < display.bounds.y - 8 || - scaledY > display.bounds.y + display.bounds.height + scaledX + (scaledWidth / 2) < display.bounds.x - 8 || // Left + scaledX + (scaledWidth / 2) > display.bounds.x + display.bounds.width || // Right + scaledY < display.bounds.y - 8 || // Top + scaledY + (scaledHeight / 2) > display.bounds.y + display.bounds.height // Bottom ) { // Window is offscreen if (is.dev()) {