[MM-36309] Restore window menu, override shortcuts for window menu so they don't interfere (#1732)

This commit is contained in:
Devin Binnie
2021-09-15 03:52:53 -04:00
committed by GitHub
parent 980eed8d8d
commit df57051eaa
2 changed files with 6 additions and 5 deletions

View File

@@ -791,6 +791,12 @@ function initializeAfterAppReady() {
globalShortcut.register(`${process.platform === 'darwin' ? 'Cmd+Ctrl' : 'Ctrl+Shift'}+S`, () => { globalShortcut.register(`${process.platform === 'darwin' ? 'Cmd+Ctrl' : 'Ctrl+Shift'}+S`, () => {
ipcMain.emit(OPEN_TEAMS_DROPDOWN); 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) { function handleUpdateMenuEvent(event: IpcMainEvent, menuConfig: Config) {
const aMenu = appMenu.createMenu(menuConfig); const aMenu = appMenu.createMenu(menuConfig);
Menu.setApplicationMenu(aMenu); Menu.setApplicationMenu(aMenu);
WindowManager.removeWindowMenu();
aMenu.addListener('menu-will-close', handleCloseAppMenu); aMenu.addListener('menu-will-close', handleCloseAppMenu);
// set up context menu for tray icon // set up context menu for tray icon

View File

@@ -554,7 +554,3 @@ function handleBrowserHistoryPush(e: IpcMainEvent, viewName: string, pathName: s
export function getCurrentTeamName() { export function getCurrentTeamName() {
return status.currentServerName; return status.currentServerName;
} }
export function removeWindowMenu() {
status.mainWindow?.removeMenu();
}