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: dock icon and tray disappearing on macOS

Louis Beaumonta591a66e55f2
diff --git a/Cargo.lock b/Cargo.lock
index 528073e16..5df466020 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6628,7 +6628,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.28"
+version = "0.3.31"
dependencies = [
"anyhow",
"bytemuck",
@@ -6681,7 +6681,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.28"
+version = "0.3.31"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -6732,7 +6732,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.28"
+version = "0.3.31"
dependencies = [
"anyhow",
"chrono",
@@ -6756,7 +6756,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.28"
+version = "0.3.31"
dependencies = [
"anyhow",
"chrono",
@@ -6774,7 +6774,7 @@ dependencies = [
[[package]]
name = "screenpipe-integrations"
-version = "0.3.28"
+version = "0.3.31"
dependencies = [
"anyhow",
"image",
@@ -6789,7 +6789,7 @@ dependencies = [
[[package]]
name = "screenpipe-server"
-version = "0.3.28"
+version = "0.3.31"
dependencies = [
"anyhow",
"async-trait",
@@ -6858,7 +6858,7 @@ dependencies = [
[[package]]
name = "screenpipe-vision"
-version = "0.3.28"
+version = "0.3.31"
dependencies = [
"accessibility-sys",
"anyhow",
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index e4946fed9..ecce29f46 100755
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -8612,7 +8612,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.0.234"
+version = "2.0.237"
dependencies = [
"anyhow",
"async-stream",
@@ -8692,7 +8692,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.28"
+version = "0.3.31"
dependencies = [
"anyhow",
"bytemuck",
@@ -8740,7 +8740,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.28"
+version = "0.3.31"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -8791,7 +8791,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.28"
+version = "0.3.31"
dependencies = [
"anyhow",
"chrono",
@@ -8815,7 +8815,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.28"
+version = "0.3.31"
dependencies = [
"anyhow",
"chrono",
@@ -8831,7 +8831,7 @@ dependencies = [
[[package]]
name = "screenpipe-integrations"
-version = "0.3.28"
+version = "0.3.31"
dependencies = [
"anyhow",
"image 0.25.5",
@@ -8846,7 +8846,7 @@ dependencies = [
[[package]]
name = "screenpipe-server"
-version = "0.3.28"
+version = "0.3.31"
dependencies = [
"anyhow",
"async-trait",
@@ -8910,7 +8910,7 @@ dependencies = [
[[package]]
name = "screenpipe-vision"
-version = "0.3.28"
+version = "0.3.31"
dependencies = [
"accessibility-sys",
"anyhow",
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 3c32e8fe6..f69a3c4c9 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs
@@ -81,6 +81,21 @@ pub async fn show_specific_window(
.set_position(tauri::Position::Physical(tauri::PhysicalPosition { x, y }));
}
+ // Add event handler to reset activation policy when window closes
+ #[cfg(target_os = "macos")]
+ {
+ let app_clone = state.app_handle.clone();
+ window.on_window_event(move |event| {
+ match event {
+ tauri::WindowEvent::Destroyed | tauri::WindowEvent::CloseRequested { .. } => {
+ info!("Custom window closed, resetting activation policy");
+ let _ = app_clone.set_activation_policy(tauri::ActivationPolicy::Regular);
+ }
+ _ => {}
+ }
+ });
+ }
+
if let Err(e) = window.show() {
error!("failed to show window: {}", e);
return Err((
@@ -626,22 +641,12 @@ impl ShowRewindWindow {
if !is_focused {
info!("Main window lost focus, hiding window");
- // #[cfg(target_os = "macos")]
- // {
- // let value = app_clone.clone();
- // app_clone.run_on_main_thread(move || {
- // if let Ok(panel) = value.get_webview_panel(RewindWindowId::Main.label()) {
- // panel.order_out(None);
- // }
-
-
- // }).ok();
- // }
-
- // #[cfg(not(target_os = "macos"))]
- // {
- // let _ = window.hide();
- // }
+ // Reset activation policy to Regular when main overlay loses focus
+ // This restores the dock icon and tray menu which are hidden in Accessory mode
+ #[cfg(target_os = "macos")]
+ {
+ let _ = app_clone.set_activation_policy(tauri::ActivationPolicy::Regular);
+ }
let _ = app_clone.emit("window-focused", false).ok();
} else {
@@ -741,6 +746,18 @@ impl ShowRewindWindow {
}).ok();
}
+ // Add event listener to reset activation policy when chat window closes or loses focus
+ let app_clone = app.clone();
+ window.on_window_event(move |event| {
+ match event {
+ tauri::WindowEvent::Destroyed | tauri::WindowEvent::CloseRequested { .. } => {
+ info!("Chat window closed, resetting activation policy");
+ let _ = app_clone.set_activation_policy(tauri::ActivationPolicy::Regular);
+ }
+ _ => {}
+ }
+ });
+
window
};