From 435ecc61210c0fcec83919599138a9073fb79c0b Mon Sep 17 00:00:00 2001 From: muwoo <2424880409@qq.com> Date: Tue, 10 Aug 2021 21:10:57 +0800 Subject: [PATCH] =?UTF-8?q?ref:=20=E4=BC=98=E5=8C=96=E8=B6=85=E7=BA=A7?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E9=A6=96=E6=AC=A1=E5=8A=A0=E8=BD=BD=E8=BF=87?= =?UTF-8?q?=E6=85=A2=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/common/listener.js | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/main/common/listener.js b/src/main/common/listener.js index a71ed10..1ede511 100644 --- a/src/main/common/listener.js +++ b/src/main/common/listener.js @@ -203,27 +203,16 @@ class Listener { superPanel(mainWindow) { // 长按右击呼起超级面板 + superPanel.init(mainWindow); ipcMain.on('right-down', async () => { const copyResult = await this.getSelectedContent(); let win = superPanel.getWindow(); - if (win) { - win.webContents.send('trigger-super-panel', { - ...copyResult, - optionPlugin: this.optionPlugin.plugins, - }); - } else { - superPanel.init(mainWindow); - win = superPanel.getWindow(); - - win.once('ready-to-show', () => { - win.webContents.send('trigger-super-panel', { - ...copyResult, - optionPlugin: this.optionPlugin.plugins, - }); - }); - } + win.webContents.send('trigger-super-panel', { + ...copyResult, + optionPlugin: this.optionPlugin.plugins, + }); const pos = this.getPos(robot.getMousePos()); win.setPosition(parseInt(pos.x), parseInt(pos.y)); win.show(); -- GitLab