main: disable default macos menu item
This commit is contained in:
1 parent
6811a45cb5
commit
5b7a0f0873
2 files changed
+14
No files matched your search
@@ -4,6 +4,7 @@ import { join, dirname } from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
import Constants from './utils/Constants'
|
||||
import { createErrorWindow, createMainWindow } from './MainRunner'
|
||||
import Menus from './utils/Menus'
|
||||
|
||||
let mainWindow
|
||||
let errorWindow
|
||||
@@ -14,6 +15,8 @@ app.on('ready', () => {
|
||||
.replace(/\\/g, '\\\\')
|
||||
}
|
||||
|
||||
Menus.macOSDisableDefaultMenuItem()
|
||||
|
||||
mainWindow = createMainWindow(mainWindow)
|
||||
})
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import { systemPreferences } from 'electron'
|
||||
import Constants from './Constants'
|
||||
|
||||
export default class Menus {
|
||||
static macOSDisableDefaultMenuItem () {
|
||||
if (Constants.IS_MAC) {
|
||||
systemPreferences.setUserDefault('NSDisabledDictationMenuItem', 'boolean', true)
|
||||
systemPreferences.setUserDefault('NSDisabledCharacterPaletteMenuItem', 'boolean', true)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user