From 06d29560224fbf6c5a3e1a52af1dcf175c8284fe Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Tue, 13 Dec 2022 00:02:15 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=94=B9=E8=BF=9B=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=89=98=E7=9B=98=E5=8D=95=E5=87=BB=E4=BA=A4=E4=BA=92=20Fix=20?= =?UTF-8?q?https://github.com/siyuan-note/siyuan/issues/6861?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/electron/main.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/app/electron/main.js b/app/electron/main.js index 2166e8f81..a53551f3b 100644 --- a/app/electron/main.js +++ b/app/electron/main.js @@ -444,17 +444,23 @@ const boot = () => { if (mainWindow.isMinimized()) { mainWindow.restore() } - showWndMenu.label = "Hide Window" - trayMenuTemplate.splice(0, 1, showWndMenu) - const contextMenu = Menu.buildFromTemplate(trayMenuTemplate) - tray.setContextMenu(contextMenu) mainWindow.show() + + if ('win32' === process.platform || 'linux' === process.platform) { + showWndMenu.label = "Hide Window" + trayMenuTemplate.splice(0, 1, showWndMenu) + const contextMenu = Menu.buildFromTemplate(trayMenuTemplate) + tray.setContextMenu(contextMenu) + } } else { mainWindow.hide() - showWndMenu.label = "Show Window" - trayMenuTemplate.splice(0, 1, showWndMenu) - const contextMenu = Menu.buildFromTemplate(trayMenuTemplate) - tray.setContextMenu(contextMenu) + + if ('win32' === process.platform || 'linux' === process.platform) { + showWndMenu.label = "Show Window" + trayMenuTemplate.splice(0, 1, showWndMenu) + const contextMenu = Menu.buildFromTemplate(trayMenuTemplate) + tray.setContextMenu(contextMenu) + } } }