Skip to content

fix: register agent hotkey as independent GNOME Wayland keybinding slot#436

Open
alumpe wants to merge 1 commit intoOpenWhispr:mainfrom
alumpe:al/agent-hotkey-registration-gnome
Open

fix: register agent hotkey as independent GNOME Wayland keybinding slot#436
alumpe wants to merge 1 commit intoOpenWhispr:mainfrom
alumpe:al/agent-hotkey-registration-gnome

Conversation

@alumpe
Copy link
Contributor

@alumpe alumpe commented Mar 14, 2026

On GNOME Wayland, Electron's globalShortcut API is blocked by the Wayland security model. OpenWhispr works around this for the dictation hotkey via native GNOME keybindings (gsettings + D-Bus), but the agent hotkey was never wired into that same system — so it silently failed to register on GNOME Wayland.

Changes

Important

registerSlot() had to be made async because the GNOME keybinding path calls into gnomeManager.registerKeybinding(), which is async. Without awaiting it, callers would receive an unresolved Promise instead of the actual { success, message } result, silently swallowing registration failures.

  • gnomeShortcut.js: Added per-slot gsettings paths (openwhispr for dictation, openwhispr-agent for agent) and a ToggleAgent D-Bus method alongside the existing Toggle, so each hotkey slot gets its own independent GNOME keybinding
  • hotkeyManager.js: registerSlot() is now async and routes non-dictation slots through GNOME keybindings instead of globalShortcut
  • ipcHandlers.js / main.js: Agent hotkey registration now awaits the result and handles failures
  • settingsStore.ts: setAgentKey() uses the new updateAgentHotkey invoke (request/response) instead of fire-and-forget notifyAgentHotkeyChanged, and rolls back the stored value on failure
  • preload.js / electron.ts: New updateAgentHotkey IPC bridge with typed return value

Before
Agent hotkey appeared to save but never triggered on GNOME Wayland.

After
Both dictation and agent hotkeys register as separate named shortcuts, visible in GNOME Settings → Keyboard → Shortcuts → Custom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant