mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +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;
|
const scaledY = windowY;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
scaledX + scaledWidth < display.bounds.x - 8 ||
|
scaledX + (scaledWidth / 2) < display.bounds.x - 8 || // Left
|
||||||
scaledX - scaledWidth > display.bounds.x + display.bounds.width ||
|
scaledX + (scaledWidth / 2) > display.bounds.x + display.bounds.width || // Right
|
||||||
scaledY < display.bounds.y - 8 ||
|
scaledY < display.bounds.y - 8 || // Top
|
||||||
scaledY > display.bounds.y + display.bounds.height
|
scaledY + (scaledHeight / 2) > display.bounds.y + display.bounds.height // Bottom
|
||||||
) {
|
) {
|
||||||
// Window is offscreen
|
// Window is offscreen
|
||||||
if (is.dev()) {
|
if (is.dev()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user