From cd5899bde535cfcc4908e615e98eb3dd7adf188c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=92=83=E7=99=BD?= <18511759309@163.com> Date: Wed, 5 Jan 2022 15:03:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E9=80=82=E9=85=8Dwindows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/browsers/main.js | 2 +- src/main/common/listener.js | 5 ++++- src/renderer/App.vue | 9 +++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/browsers/main.js b/src/main/browsers/main.js index 61b9da6..f9959d0 100755 --- a/src/main/browsers/main.js +++ b/src/main/browsers/main.js @@ -29,7 +29,7 @@ module.exports = () => { backgroundThrottling: false, contextIsolation: false, webviewTag: true, - devTools: true, + devTools: false, nodeIntegration: true, // 在网页中集成Node preload: `${path.resolve(__dirname, "./preload.js")}` } diff --git a/src/main/common/listener.js b/src/main/common/listener.js index 77423bb..80c416a 100755 --- a/src/main/common/listener.js +++ b/src/main/common/listener.js @@ -417,6 +417,7 @@ class Listener { windowMoveInit(win) { let hasInit = false; ipcMain.on("window-move", () => { + let bounds = win.getBounds(); if (!hasInit) { hasInit = true; ioHook.start(false); @@ -432,7 +433,9 @@ class Listener { winStartPosition.x + cursorPosition.x - mouseStartPosition.x; const dy = winStartPosition.y + cursorPosition.y - mouseStartPosition.y; - win.setPosition(parseInt(dx), parseInt(dy)); + bounds.x = parseInt(dx); + bounds.y = parseInt(dy); + win.setBounds(bounds); }); ioHook.on("mouseup", e => { diff --git a/src/renderer/App.vue b/src/renderer/App.vue index b9ca7e9..c791a47 100755 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -1,6 +1,6 @@