mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
Merge pull request #674 from th-ch/picture-in-picture-plugin
Add "Picture in picture" plugin
This commit is contained in:
12
index.js
12
index.js
@ -178,7 +178,12 @@ function createMainWindow() {
|
||||
win.on("move", () => {
|
||||
if (win.isMaximized()) return;
|
||||
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;
|
||||
@ -191,7 +196,10 @@ function createMainWindow() {
|
||||
winWasMaximized = 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", {
|
||||
width: windowSize[0],
|
||||
height: windowSize[1],
|
||||
|
||||
Reference in New Issue
Block a user