From 26c2ab6ff33b62ead5a9cbc09cde458781561176 Mon Sep 17 00:00:00 2001 From: luckliu <8473136@qq.com> Date: Fri, 1 Dec 2023 16:23:16 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20window=E7=B3=BB=E7=BB=9F=E6=89=98?= =?UTF-8?q?=E7=9B=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/main/index.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/electron/main/index.ts b/electron/main/index.ts index 35e6b77..6e650d7 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -84,9 +84,9 @@ async function createWindow() { const {Menu} = require("electron"); Menu.setApplicationMenu(null); // hide menu for Mac - if (process.platform !== "darwin") { - app.dock.hide(); - } + // if (process.platform !== "darwin") { + // app.dock.hide(); + // } win.on('minimize', function (event) { event.preventDefault(); @@ -128,6 +128,11 @@ export const createTray = () => { tray.setToolTip('Frpc Desktop') const contextMenu = Menu.buildFromTemplate(menu) tray.setContextMenu(contextMenu) + + // 托盘双击打开 + tray.on('double-click', () => { + win.show(); + }) } app.whenReady().then(() => {