From 14326d24403be01e9fa1b56b7b5014d0e5b7e40b Mon Sep 17 00:00:00 2001 From: TC Date: Sat, 9 Apr 2022 12:16:30 +0200 Subject: [PATCH] Only save size/position if not in PiP --- index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 2fdfac58..21110b5b 100644 --- a/index.js +++ b/index.js @@ -174,7 +174,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; @@ -187,7 +192,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],