mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
Only save size/position if not in PiP
This commit is contained in:
12
index.js
12
index.js
@ -174,7 +174,12 @@ function createMainWindow() {
|
|||||||
win.on("move", () => {
|
win.on("move", () => {
|
||||||
if (win.isMaximized()) return;
|
if (win.isMaximized()) return;
|
||||||
let position = win.getPosition();
|
let position = win.getPosition();
|
||||||
lateSave("window-position", { x: position[0], y: position[1] });
|
const isPiPEnabled =
|
||||||
|
config.plugins.isEnabled("picture-in-picture") &&
|
||||||
|
config.plugins.getOptions("picture-in-picture")["isInPiP"];
|
||||||
|
if (!isPiPEnabled) {
|
||||||
|
lateSave("window-position", { x: position[0], y: position[1] });
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let winWasMaximized;
|
let winWasMaximized;
|
||||||
@ -187,7 +192,10 @@ function createMainWindow() {
|
|||||||
winWasMaximized = isMaximized;
|
winWasMaximized = isMaximized;
|
||||||
config.set("window-maximized", isMaximized);
|
config.set("window-maximized", isMaximized);
|
||||||
}
|
}
|
||||||
if (!isMaximized) {
|
const isPiPEnabled =
|
||||||
|
config.plugins.isEnabled("picture-in-picture") &&
|
||||||
|
config.plugins.getOptions("picture-in-picture")["isInPiP"];
|
||||||
|
if (!isMaximized && !isPiPEnabled) {
|
||||||
lateSave("window-size", {
|
lateSave("window-size", {
|
||||||
width: windowSize[0],
|
width: windowSize[0],
|
||||||
height: windowSize[1],
|
height: windowSize[1],
|
||||||
|
|||||||
Reference in New Issue
Block a user