mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
fix multiple monitor calculations
This commit is contained in:
4
index.js
4
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}`);
|
||||
|
||||
Reference in New Issue
Block a user