I know there's already a fix #12167 but I still have that problem sometimes, for example I use a shortcut <alt+F3> in vscode that focus the menu bar everytime, I ended up using the custom menu bar to disable that behaviour, but other Electron apps don't have that. Would it be ...
As an ugly workaround, you can setautoHideMenuBarto true creating the BrowserWindow. So menu will remain hidden until user presses alt key. After you've done the above, an even uglier workaround is to disable the alt key press - document.addEventListener('keydown', (event) => { if(even...
function createWindow () { // 隐藏菜单栏 Menu.setApplicationMenu(null) // Create the browser window.设置窗口宽高,最小宽高,图标等 mainWindow = new BrowserWindow({ width: 800, height: 600, minWidth: 1280, minHeight: 800, resizable: false, allowRunningInsecureContent: true, experimentalCanvasFe...
;// app.commandLine.appendSwitch("--disable-http-cache") 禁用缓存// mainWindow.webContents.openDevTools({mode:'bottom'});mainWindow.show();}app.on('ready',function(){console.log("ready...");createWindow();});// Quit when all windows are closed.app.on('window-all-closed',function(){...
state.actionBtnDisable=true;if("shutdown"=== command ||"reboot"=== command) {letwarningText ="确定要重启吗?";letokBtnText ="确定重启";letcommandFun ="rebootOs";if("shutdown"=== command) { warningText ="确定要关机吗?"; okBtnText ="确定关机"; ...
{ // disable automated devtools opening on error when running extension tests // as this can lead to nondeterministic test execution (devtools steals focus) forceDisableShowDevtoolsOnError: typeof windowConfig.extensionTestsPath === 'string' || windowConfig['enable-smoke-test-driver'] === true...
disableAutoHideCursor boolean 是否在打字时隐藏光标。默认值 (false) autoHideMenuBar boolean 自动隐藏菜单栏,除非按了_(Alt)_键。默认值 (false) enableLargerThanScreen boolean (mac) 使窗口尺寸可大于屏幕的大小。其他操作系统默认允许大于屏幕的窗口。默认值 (false) ...
disableAutoHideCursor boolean 是否在打字时隐藏光标。默认值 (false) autoHideMenuBar boolean 自动隐藏菜单栏,除非按了_(Alt)_键。默认值 (false) enableLargerThanScreen boolean (mac) 使窗口尺寸可大于屏幕的大小。其他操作系统默认允许大于屏幕的窗口。默认值 (false) ...
求助整个流程是怎么实现的,可以详细讲解下嘛,我只简单实现主页面点击关闭按钮,我的托盘也不知道怎么实现。app.on('window-all-closed', function(){ // On macOS it is common for applications and their menu bar // to stay active until the user quits explicitly with Cmd + Q if (process.platform ...
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = true const createWindow = () => { let win = new WindowManager() win.create({isMajor: true}) // 系统托盘管理 win.trayManager() // 监听ipcMain事件 win.ipcManager() } app.whenReady().then(() => { ...