Skip to content

The open-source AI voice studio. Clone, dictate, create.

fix(linux): gate exit-on-close to Linux and apply it to the emit-failure fallback; keep the Windows recipe's doc comment

jamiepine11073d9a2031
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4c0a14f8..3043bcd4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,7 +18,7 @@
- **Installing the CUDA or ROCm backend on Linux downloads a native Linux binary.** The GPU server release assets are now platform-qualified (`voicebox-server-{cuda,rocm}-<platform>.tar.gz`, `{cuda,rocm}-libs-<platform>-<version>.tar.gz`) and a `build-gpu-linux` release job builds the Linux CUDA and ROCm bundles alongside the Windows ones, so Linux no longer fetches a Windows `.exe` and silently falls back to CPU. The ROCm download is offered on Linux hosts with an AMD ROCm driver (`/dev/kfd`), and the CUDA download gate from 0.6 now refuses only platforms without a published asset (macOS, Linux arm64). — @1337hero, @smendola ([#851](https://github.com/jamiepine/voicebox/pull/851), [#561](https://github.com/jamiepine/voicebox/pull/561); fixes [#767](https://github.com/jamiepine/voicebox/issues/767))
### Linux
-- **Closing the window quits the app.** With "Keep server running" off, closing the main window on Linux left the Tauri process alive after the backend had stopped (the hidden dictation pill window kept it running), and its speak monitor retried `/events/speak` every 30 seconds forever. The close flow now exits the application once the frontend finishes its cleanup, or after the 5-second timeout. — @Fulminao ([#1040](https://github.com/jamiepine/voicebox/pull/1040))
+- **Closing the window quits the app.** With "Keep server running" off, closing the main window on Linux left the Tauri process alive after the backend had stopped (the hidden dictation pill window kept it running), and its speak monitor retried `/events/speak` every 30 seconds forever. On Linux the close flow now exits the application once the frontend finishes its cleanup, or after the 5-second timeout; macOS and Windows keep their existing close behaviour. — @Fulminao ([#1040](https://github.com/jamiepine/voicebox/pull/1040))
- **`just build-server-cuda` works on Linux.** The recipe builds the CUDA backend with `build_binary.py --cuda` and installs it into `$XDG_DATA_HOME/sh.voicebox.app/backends/cuda` (default `~/.local/share`), matching the Windows recipe. — @Fulminao ([#1044](https://github.com/jamiepine/voicebox/pull/1044))
## [0.6.0] - 2026-10-04
diff --git a/justfile b/justfile
index be3192da..cd9d6ecf 100644
--- a/justfile
+++ b/justfile
@@ -344,6 +344,7 @@ build-server-cuda: _ensure-venv
cp -a backend/dist/voicebox-server-cuda/. "${XDG_DATA_HOME:-$HOME/.local/share}/sh.voicebox.app/backends/cuda/"
chmod +x "${XDG_DATA_HOME:-$HOME/.local/share}/sh.voicebox.app/backends/cuda/voicebox-server-cuda"
+# Build CUDA server binary and place in app data dir for local testing
[windows]
build-server-cuda: _ensure-venv
$ErrorActionPreference = "Stop"; \
diff --git a/tauri/src-tauri/src/main.rs b/tauri/src-tauri/src/main.rs
index 95565637..91ca3be2 100644
--- a/tauri/src-tauri/src/main.rs
+++ b/tauri/src-tauri/src/main.rs
@@ -1380,6 +1380,23 @@ async fn debug_clipboard_roundtrip(
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
+/// Final step of the main-window close flow, after the frontend has had its
+/// chance to stop the server.
+///
+/// On Linux, closing the main window must exit the process: the hidden dictate
+/// pill webview is still a window, so Tauri would otherwise keep running with
+/// no UI, the backend already stopped, and `speak_monitor` retrying
+/// `/events/speak` every 30 s (#1040). On macOS and Windows the window just
+/// closes, as before, so "Keep server running" plus the global hotkey keep
+/// dictation available without the main window.
+fn finish_main_window_close(window: &tauri::Window) {
+ if cfg!(target_os = "linux") {
+ window.app_handle().exit(0);
+ } else {
+ window.close().ok();
+ }
+}
+
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_dialog::init())
@@ -1550,7 +1567,7 @@ pub fn run() {
if let Err(e) = app_handle.emit("window-close-requested", ()) {
eprintln!("Failed to emit window-close-requested event: {}", e);
- window.close().ok();
+ finish_main_window_close(window);
return;
}
@@ -1566,12 +1583,12 @@ pub fn run() {
tauri::async_runtime::spawn(async move {
tokio::select! {
_ = rx.recv() => {
- println!("Frontend cleanup complete, exiting application");
- window_for_close.app_handle().exit(0);
+ println!("Frontend cleanup complete, closing");
+ finish_main_window_close(&window_for_close);
}
_ = tokio::time::sleep(tokio::time::Duration::from_secs(5)) => {
- eprintln!("Window close timeout, exiting application anyway");
- window_for_close.app_handle().exit(0);
+ eprintln!("Window close timeout, closing anyway");
+ finish_main_window_close(&window_for_close);
}
}
window_for_close.unlisten(listener_id);