Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(macos): crash from setSharingType called off main thread in PermissionRecovery window

Louis Beaumont52c54e4bfbb5
diff --git a/Cargo.lock b/Cargo.lock
index 87f96f238..e940d1e5c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6628,7 +6628,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.42"
+version = "0.3.44"
dependencies = [
"anyhow",
"bytemuck",
@@ -6681,7 +6681,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.42"
+version = "0.3.44"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -6732,7 +6732,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.42"
+version = "0.3.44"
dependencies = [
"anyhow",
"chrono",
@@ -6756,7 +6756,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.42"
+version = "0.3.44"
dependencies = [
"anyhow",
"chrono",
@@ -6774,7 +6774,7 @@ dependencies = [
[[package]]
name = "screenpipe-integrations"
-version = "0.3.42"
+version = "0.3.44"
dependencies = [
"anyhow",
"image",
@@ -6789,7 +6789,7 @@ dependencies = [
[[package]]
name = "screenpipe-server"
-version = "0.3.42"
+version = "0.3.44"
dependencies = [
"anyhow",
"async-trait",
@@ -6858,7 +6858,7 @@ dependencies = [
[[package]]
name = "screenpipe-vision"
-version = "0.3.42"
+version = "0.3.44"
dependencies = [
"accessibility-sys",
"anyhow",
diff --git a/Cargo.toml b/Cargo.toml
index 680d7c7b5..2cf9a98d0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,7 +6,7 @@ exclude = ["apps/screenpipe-app-tauri/src-tauri"]
resolver = "2"
[workspace.package]
-version = "0.3.44"
+version = "0.3.45"
authors = ["louis030195 <[email protected]>"]
description = ""
repository = "https://github.com/screenpipe/screenpipe"
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index 9057c1f90..b797c0540 100755
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -9007,7 +9007,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.0.248"
+version = "2.0.250"
dependencies = [
"anyhow",
"async-stream",
@@ -9089,7 +9089,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.42"
+version = "0.3.44"
dependencies = [
"anyhow",
"bytemuck",
@@ -9137,7 +9137,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.42"
+version = "0.3.44"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -9188,7 +9188,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.42"
+version = "0.3.44"
dependencies = [
"anyhow",
"chrono",
@@ -9212,7 +9212,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.42"
+version = "0.3.44"
dependencies = [
"anyhow",
"chrono",
@@ -9228,7 +9228,7 @@ dependencies = [
[[package]]
name = "screenpipe-integrations"
-version = "0.3.42"
+version = "0.3.44"
dependencies = [
"anyhow",
"image 0.25.9",
@@ -9243,7 +9243,7 @@ dependencies = [
[[package]]
name = "screenpipe-server"
-version = "0.3.42"
+version = "0.3.44"
dependencies = [
"anyhow",
"async-trait",
@@ -9307,7 +9307,7 @@ dependencies = [
[[package]]
name = "screenpipe-vision"
-version = "0.3.42"
+version = "0.3.44"
dependencies = [
"accessibility-sys",
"anyhow",
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index a3f8834b9..c46168f16 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "2.0.250"
+version = "2.0.251"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs b/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs
index 27bf04854..7236d7b93 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs
@@ -793,19 +793,23 @@ impl ShowRewindWindow {
let window = builder.build()?;
// Exclude from screen capture (NSWindowSharingNone = 0)
+ // MUST run on main thread - AppKit window operations crash from background threads
#[cfg(target_os = "macos")]
{
- use raw_window_handle::HasWindowHandle;
- if let Ok(handle) = window.window_handle() {
- if let raw_window_handle::RawWindowHandle::AppKit(appkit_handle) = handle.as_raw() {
- use objc::{msg_send, sel, sel_impl};
- let ns_view = appkit_handle.ns_view.as_ptr() as *mut objc::runtime::Object;
- let ns_window: *mut objc::runtime::Object = unsafe { msg_send![ns_view, window] };
- if !ns_window.is_null() {
- let _: () = unsafe { msg_send![ns_window, setSharingType: 0_u64] };
+ let window_clone = window.clone();
+ app.run_on_main_thread(move || {
+ use raw_window_handle::HasWindowHandle;
+ if let Ok(handle) = window_clone.window_handle() {
+ if let raw_window_handle::RawWindowHandle::AppKit(appkit_handle) = handle.as_raw() {
+ use objc::{msg_send, sel, sel_impl};
+ let ns_view = appkit_handle.ns_view.as_ptr() as *mut objc::runtime::Object;
+ let ns_window: *mut objc::runtime::Object = unsafe { msg_send![ns_view, window] };
+ if !ns_window.is_null() {
+ let _: () = unsafe { msg_send![ns_window, setSharingType: 0_u64] };
+ }
}
}
- }
+ }).ok();
}
window