Skip to content

fix(desktop): reserve PTT shortcut only during active huddle#1315

Merged
wesbillman merged 1 commit into
mainfrom
brain/ptt-shortcut-gate
Jun 26, 2026
Merged

fix(desktop): reserve PTT shortcut only during active huddle#1315
wesbillman merged 1 commit into
mainfrom
brain/ptt-shortcut-gate

Conversation

@wesbillman

Copy link
Copy Markdown
Collaborator

Summary

Fixes the original push-to-talk keyboard-shortcut conflict: Ctrl+Space was registered as a global shortcut at app startup and reserved with the OS for the entire app lifetime, so it conflicted with IDEs and other apps even when no huddle was running.

This is a clean, minimal redo of #1306 (closed) — without the Cargo feature, ci.yml change, capability removal, or settings-UI/persistence layer that PR had accumulated.

What changed

  • ptt_shortcut.rs (new): sync_registration() reserves Ctrl+Space with the OS only while a huddle is Connected/Active and the voice input mode is push-to-talk; unregisters otherwise. Idempotent and best-effort (failures logged, never fatal — VAD mode still works without it).
  • lib.rs: removed the unconditional startup registration block (the bug). The global-shortcut plugin is now gated behind #[cfg(not(test))] so the lib-test binary never links it.
  • app_state.rs: sync_registration is called at the end of emit_huddle_state_changed — the single chokepoint hit by every huddle phase transition, including teardown.
  • huddle/mod.rs: one extra sync_registration call in set_voice_input_mode (the one state change that doesn't emit).

Why the cfg(not(test)) gate

The previous PR's Windows failures (STATUS_ENTRYPOINT_NOT_FOUND, 0xc0000139) came from tauri-plugin-global-shortcut being linked into the Windows lib-test executable, which then failed to load before any test ran. Excluding the plugin from cfg(test) builds removes that link entirely — no Cargo feature, no ci.yml edit, no capability changes needed.

Validation (local)

  • just desktop-tauri-test729 passed, 0 failed; the test binary compiles with the plugin excluded.
  • just desktop-tauri-check (real app, plugin included) — compiles clean.
  • cargo fmt --check — clean.

Note

main is currently red on some Desktop / E2E jobs independent of this change, so those may fail here too. The signal for this PR is Windows Rust and Unit Tests.

@wesbillman wesbillman force-pushed the brain/ptt-shortcut-gate branch 2 times, most recently from 80f9ca7 to 8f803f0 Compare June 26, 2026 21:39
The push-to-talk Ctrl+Space global shortcut was registered with the OS at
startup and held for the entire app lifetime, conflicting with IDEs and other
apps even when no huddle was running.

Register the shortcut only while a huddle is Connected/Active and the voice
input mode is push-to-talk; unregister on teardown or when switching to VAD.
Registration is synced from huddle state at the existing state-change
chokepoint plus the voice-mode switch.

Gate the global-shortcut plugin behind cfg(not(test)) so the lib-test binary
never links it — that link is what made the Windows test executable fail to
load with STATUS_ENTRYPOINT_NOT_FOUND.

Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
@wesbillman wesbillman force-pushed the brain/ptt-shortcut-gate branch from 8f803f0 to a569f97 Compare June 26, 2026 21:45
@wesbillman wesbillman merged commit 6c60cb5 into main Jun 26, 2026
25 checks passed
@wesbillman wesbillman deleted the brain/ptt-shortcut-gate branch June 26, 2026 23:31
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