ELECTRON-720 - Set menu to null (#513)

This commit is contained in:
Kiran Niranjan 2018-10-29 14:35:00 +05:30 committed by Vishwas Shashidhar
parent bae410ebbb
commit 0d44901180
3 changed files with 14 additions and 0 deletions

View File

@ -9,6 +9,7 @@ const logLevels = require('../enums/logLevels.js');
const { version, clientVersion, buildNumber } = require('../../package.json');
const { initCrashReporterMain, initCrashReporterRenderer } = require('../crashReporter.js');
const i18n = require('../translation/i18n');
const { isMac } = require('../utils/misc');
let aboutWindow;
@ -88,6 +89,10 @@ function openAboutWindow(windowName) {
initCrashReporterMain({ process: 'about app window' });
initCrashReporterRenderer(aboutWindow, { process: 'render | about app window' });
aboutWindow.webContents.send('versionInfo', { version, clientVersion, buildNumber });
if (!isMac) {
// prevents from displaying menu items when "alt" key is pressed
aboutWindow.setMenu(null);
}
});
aboutWindow.webContents.on('crashed', function () {

View File

@ -105,6 +105,10 @@ function openBasicAuthWindow(windowName, hostname, isValidCredentials, clearSett
initCrashReporterRenderer(basicAuthWindow, { process: 'render | basic auth window' });
basicAuthWindow.webContents.send('hostname', hostname);
basicAuthWindow.webContents.send('isValidCredentials', isValidCredentials);
if (!isMac) {
// prevents from displaying menu items when "alt" key is pressed
basicAuthWindow.setMenu(null);
}
});
basicAuthWindow.webContents.on('crashed', function () {

View File

@ -12,6 +12,7 @@ const notify = require('./../electron-notify');
const eventEmitter = require('./../../eventEmitter');
const { updateConfigField } = require('../../config');
const i18n = require('../../translation/i18n');
const { isMac } = require('../../utils/misc');
let configurationWindow;
let screens;
@ -129,6 +130,10 @@ function openConfigurationWindow(windowName) {
configurationWindow.webContents.send('screens', screens);
}
configurationWindow.webContents.send('notificationSettings', {position: position, display: display});
if (!isMac) {
// prevents from displaying menu items when "alt" key is pressed
configurationWindow.setMenu(null);
}
});
configurationWindow.on('close', () => {