fix: strip playback menu accelerators while command palette is open (#2055)

On macOS, menu item accelerators (e.g. Space for Play/Pause) fire even
when an input has focus, bypassing the renderer-side useHotkeys guard
added in #1925. Typing a space character in the command palette search
toggled play/pause instead of inserting a space.

Track command palette open state in the main process via IPC. When the
palette is open, rebuild the application menu with empty playback
accelerators so single-key shortcuts no longer intercept keystrokes
intended for the search input. Restore accelerators when the palette
closes.

Co-authored-by: Jack McCrea <jack@MacBookPro.lan>
This commit is contained in:
muckymucky
2026-05-25 19:24:15 +01:00
committed by GitHub
parent 28b8894b49
commit 3122f4121e
3 changed files with 21 additions and 1 deletions
+5
View File
@@ -54,6 +54,10 @@ const forceGarbageCollection = (): boolean => {
}
};
const setCommandPaletteOpen = (opened: boolean) => {
ipcRenderer.send('command-palette-state', opened);
};
const rendererOpenSettings = (cb: () => void) => {
ipcRenderer.on('renderer-open-settings', () => cb());
};
@@ -101,6 +105,7 @@ export const utils = {
rendererTogglePrivateMode,
rendererToggleSidebar,
rendererUpdateAvailable,
setCommandPaletteOpen,
startPowerSaveBlocker,
stopPowerSaveBlocker,
};