Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

only exit if explicitly requested

Brendan Allan534cac56f9bc
diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs
index d3389a602..e26d5a79f 100644
--- a/apps/desktop/src-tauri/src/lib.rs
+++ b/apps/desktop/src-tauri/src/lib.rs
@@ -2388,6 +2388,11 @@ pub async fn run(recording_logging_handle: LoggingHandle) {
ShowCapWindow::Main.show(handle).ok();
}
}
+ tauri::RunEvent::ExitRequested { code, api, .. } => {
+ if code != Some(0) {
+ api.prevent_exit();
+ }
+ }
_ => {}
});
}