fix(Linux): remove app menu shown pressing ALT key

This commit is contained in:
Fabio Di Stasio 2023-03-06 18:29:53 +01:00
parent 9ef475ec3f
commit 63fece2a1b
3 changed files with 7 additions and 2 deletions

View File

@ -75,7 +75,7 @@ export class ShortcutRegister {
for (const key of shortcut.keys) {
try {
this._menu.append(new MenuItem({
label: 'Shortcuts',
label: '.',
visible: false,
submenu: [{
label: String(key),

View File

@ -52,7 +52,6 @@ async function createMainWindow () {
trafficLightPosition: isMacOS ? { x: 10, y: 8 } : undefined,
backgroundColor: '#1d1d1d'
});
window.removeMenu();
mainWindowState.manage(window);
window.on('moved', saveWindowState);

View File

@ -130,6 +130,12 @@ onMounted(() => {
node = node.parentNode;
}
});
document.addEventListener('keydown', e => {
if (e.altKey && e.key === 'Alt') { // Prevent Alt key to trigger hidden shortcut menu
e.preventDefault();
}
});
});
</script>