From 963bd989c442ab6d70b99405b40f7bed1189ef14 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 31 Aug 2022 04:30:13 -0700 Subject: [PATCH] perf - disable electron from setting a default menu (#159660) --- src/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 41c50d9518b18..67e4764e3a072 100644 --- a/src/main.js +++ b/src/main.js @@ -24,7 +24,7 @@ const { getUserDataPath } = require('./vs/platform/environment/node/userDataPath const { stripComments } = require('./vs/base/common/stripComments'); /** @type {Partial} */ const product = require('../product.json'); -const { app, protocol, crashReporter } = require('electron'); +const { app, protocol, crashReporter, Menu } = require('electron'); // Enable portable support const portable = bootstrapNode.configurePortable(product); @@ -43,6 +43,9 @@ const codeCachePath = getCodeCachePath(); // Configure static command line arguments const argvConfig = configureCommandlineSwitchesSync(args); +// Disable default menu (https://github.com/electron/electron/issues/35512) +Menu.setApplicationMenu(null); + // Configure crash reporter perf.mark('code/willStartCrashReporter'); // If a crash-reporter-directory is specified we store the crash reports