feat #14740: automatic call detection on windows

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
hauke
2026-11-05 15:38:55 +01:00
co-authored by Claude Opus 5.5
parent 61bf18e47f
commit d631252600
15 changed files with 1255 additions and 71 deletions
+13 -2
View File
@@ -7,7 +7,7 @@ use tauri::tray::{MouseButton, MouseButtonState, TrayIconBuilder, TrayIconEvent}
use tauri::{AppHandle, Manager};
use crate::commands;
use crate::state::AppState;
use crate::state::{AppState, RecordingState};
const OPEN: &str = "open";
const RECORD: &str = "record";
@@ -34,6 +34,13 @@ pub fn create(app: &AppHandle) -> tauri::Result<()> {
commands::show_recorder_if_recording(app);
}
RECORD => {
if matches!(
app.state::<AppState>().recording_state(),
RecordingState::Recording { .. }
) {
commands::show_recorder(app);
return;
}
// Opening the audio devices can take a moment; keep the
// event loop free.
let app = app.clone();
@@ -67,7 +74,11 @@ pub fn create(app: &AppHandle) -> tauri::Result<()> {
fn quit(app: &AppHandle) {
let app = app.clone();
thread::spawn(move || {
if let Err(e) = app.state::<AppState>().stop_recording() {
if let Some(Err(e)) = app
.state::<AppState>()
.stop_recording()
.map(|ended| ended.result)
{
log::error!("stopping the recording on quit failed: {e}");
}
app.exit(0);