From 898c0b08fa9bef18f58f0211a990ea1c2adce37c Mon Sep 17 00:00:00 2001 From: ace-beattie Date: Thu, 5 May 2022 20:46:49 -0600 Subject: [PATCH] Move to original location on miniplayer close. --- src/main/base/browserwindow.ts | 5 +++++ src/renderer/main/vueapp.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/main/base/browserwindow.ts b/src/main/base/browserwindow.ts index 8ec13a9d..99300827 100644 --- a/src/main/base/browserwindow.ts +++ b/src/main/base/browserwindow.ts @@ -1043,6 +1043,11 @@ export class BrowserWindow { BrowserWindow.win.setResizable(!lock); }); + // Move window + ipcMain.on("windowmove", (_event, x, y) => { + BrowserWindow.win.setBounds({x, y}); + }); + //Fullscreen ipcMain.on('setFullScreen', (_event, flag) => { BrowserWindow.win.setFullScreen(flag) diff --git a/src/renderer/main/vueapp.js b/src/renderer/main/vueapp.js index e957839d..ebb778aa 100644 --- a/src/renderer/main/vueapp.js +++ b/src/renderer/main/vueapp.js @@ -148,6 +148,8 @@ const app = new Vue({ }, tmpHeight: '', tmpWidth: '', + tmpX: '', + tmpY: '', tmpVar: [], notification: false, chrome: { @@ -4109,6 +4111,8 @@ const app = new Vue({ if (flag) { this.tmpWidth = window.innerWidth; this.tmpHeight = window.innerHeight; + this.tmpX = window.screenX; + this.tmpY = window.screenY; ipcRenderer.send('unmaximize'); ipcRenderer.send('windowmin', 250, 250) ipcRenderer.send('windowresize', 300, 300, false) @@ -4116,6 +4120,7 @@ const app = new Vue({ } else { ipcRenderer.send('windowmin', 844, 410) ipcRenderer.send('windowresize', this.tmpWidth, this.tmpHeight, false) + ipcRenderer.send('windowmove', this.tmpX, this.tmpY) ipcRenderer.send('windowontop', false) //this.cfg.visual.miniplayer_top_toggle = true; app.appMode = 'player';