fix: register agent hotkey as independent GNOME Wayland keybinding slot#436
Open
alumpe wants to merge 1 commit intoOpenWhispr:mainfrom
Open
fix: register agent hotkey as independent GNOME Wayland keybinding slot#436alumpe wants to merge 1 commit intoOpenWhispr:mainfrom
alumpe wants to merge 1 commit intoOpenWhispr:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 madeasyncbecause the GNOME keybinding path calls intognomeManager.registerKeybinding(), which isasync. 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 keybindinghotkeyManager.js:registerSlot()is now async and routes non-dictation slots through GNOME keybindings instead of globalShortcutipcHandlers.js/main.js: Agent hotkey registration now awaits the result and handles failuressettingsStore.ts:setAgentKey()uses the new updateAgentHotkey invoke (request/response) instead of fire-and-forgetnotifyAgentHotkeyChanged, and rolls back the stored value on failurepreload.js/electron.ts: New updateAgentHotkey IPC bridge with typed return valueBefore
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.