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): overlay panel visible on first shortcut press

Louis Beaumontf84377fb23e3
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 276cd82f5..7d657faad 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs
@@ -1555,6 +1555,26 @@ impl ShowRewindWindow {
NSWindowCollectionBehavior::NSWindowCollectionBehaviorIgnoresCycle |
NSWindowCollectionBehavior::NSWindowCollectionBehaviorFullScreenAuxiliary
);
+
+ // Make the panel visible on first creation.
+ // Without this, the panel is created hidden and requires
+ // a second shortcut press to trigger show_existing_main().
+ save_frontmost_app();
+ unsafe {
+ let _: () = objc::msg_send![&*panel, setAlphaValue: 1.0f64];
+ }
+ panel.order_front_regardless();
+ panel.make_key_window();
+ unsafe {
+ make_webview_first_responder(&panel);
+ }
+
+ // Remove MoveToActiveSpace so the panel stays pinned to
+ // this Space (same as show_existing_main).
+ panel.set_collection_behaviour(
+ NSWindowCollectionBehavior::NSWindowCollectionBehaviorIgnoresCycle |
+ NSWindowCollectionBehavior::NSWindowCollectionBehaviorFullScreenAuxiliary
+ );
}
});
} else {