From df57051eaa78ab99f8a0e8fbbc3bfc279a46c613 Mon Sep 17 00:00:00 2001 From: Devin Binnie <52460000+devinbinnie@users.noreply.github.com> Date: Wed, 15 Sep 2021 03:52:53 -0400 Subject: [PATCH] [MM-36309] Restore window menu, override shortcuts for window menu so they don't interfere (#1732) --- src/main/main.ts | 7 ++++++- src/main/windows/windowManager.ts | 4 ---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/main.ts b/src/main/main.ts index a8531b08..b38d558b 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -791,6 +791,12 @@ function initializeAfterAppReady() { globalShortcut.register(`${process.platform === 'darwin' ? 'Cmd+Ctrl' : 'Ctrl+Shift'}+S`, () => { ipcMain.emit(OPEN_TEAMS_DROPDOWN); }); + + if (process.platform === 'linux') { + globalShortcut.registerAll(['Alt+F', 'Alt+E', 'Alt+V', 'Alt+H', 'Alt+W', 'Alt+P'], () => { + // do nothing because we want to supress the menu popping up + }); + } } // @@ -856,7 +862,6 @@ function handleCloseAppMenu() { function handleUpdateMenuEvent(event: IpcMainEvent, menuConfig: Config) { const aMenu = appMenu.createMenu(menuConfig); Menu.setApplicationMenu(aMenu); - WindowManager.removeWindowMenu(); aMenu.addListener('menu-will-close', handleCloseAppMenu); // set up context menu for tray icon diff --git a/src/main/windows/windowManager.ts b/src/main/windows/windowManager.ts index 3c3b67b5..519f5c4d 100644 --- a/src/main/windows/windowManager.ts +++ b/src/main/windows/windowManager.ts @@ -554,7 +554,3 @@ function handleBrowserHistoryPush(e: IpcMainEvent, viewName: string, pathName: s export function getCurrentTeamName() { return status.currentServerName; } - -export function removeWindowMenu() { - status.mainWindow?.removeMenu(); -}