mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-10-04 01:25:18 -07:00
The floating dictation pill is an ordinary NSWindow, which macOS never admits to another app's native fullscreen Space. The pill therefore never appears in fullscreen, its WKWebView stays occluded, and getUserMedia never resolves, so recording only starts after leaving fullscreen. Convert the pill to a key-capable NSPanel (the window class fullscreen Spaces accept; key-capable so WebKit permits mic capture) with a CanJoinAllSpaces | FullScreenAuxiliary collection behavior, and order it front with orderFrontRegardless on every show. Also fix desktop text injection: capture_focus() read the system-wide focused element, which resolved to the pill itself while it briefly held key focus. That dropped the transcript (paste-into-self guard) and let the pill swallow the user's next keypress. Target the frontmost application instead (always the real dictation target, since the pill is a non-activating panel), fall back to it for apps that expose no AX focus (terminals, some Electron windows), and restore the pill without re-taking key focus after paste so the target keeps keyboard focus. Co-Authored-By: Claude Fable 5 <[email protected]>