mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 10:11:46 +00:00
fix: Window gets stuck offscreen in some instances (#2303)
Improved offscreen detection logic, fixes th-ch#1894
This commit is contained in:
@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user