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

feat: setting to show overlay in screen recording apps

Louis Beaumont12a99359329c
diff --git a/apps/screenpipe-app-tauri/components/settings/general-settings.tsx b/apps/screenpipe-app-tauri/components/settings/general-settings.tsx
index e54feae84..69034442d 100644
--- a/apps/screenpipe-app-tauri/components/settings/general-settings.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/general-settings.tsx
@@ -271,6 +271,41 @@ export default function GeneralSettings() {
</div>
</CardContent>
</Card>
+ <Card className="border-border bg-card shadow-sm">
+ <CardContent className="p-6">
+ <div className="flex items-center justify-between">
+ <div className="flex items-start space-x-4">
+ <div className="p-2 bg-muted rounded-lg">
+ <Monitor className="h-5 w-5 text-muted-foreground" />
+ </div>
+ <div className="space-y-1 flex-1">
+ <h3 className="text-lg font-semibold text-foreground">
+ Show Overlay in Screen Recording
+ </h3>
+ <p className="text-sm text-muted-foreground leading-relaxed">
+ Allow screen recording apps (Screen Studio, OBS, etc.) to capture the overlay.
+ Disabled by default so screenpipe&apos;s own recordings don&apos;t include the UI.
+ Enable this when making product demos.
+ </p>
+ </div>
+ </div>
+ <Switch
+ checked={settings?.showOverlayInScreenRecording ?? false}
+ onCheckedChange={(checked) => {
+ handleSettingsChange({ showOverlayInScreenRecording: checked });
+ // Hide existing panels so they get recreated with new sharing type
+ import("@tauri-apps/api/core").then(({ invoke }) => {
+ invoke("reset_main_window").catch(() => {});
+ });
+ toast({
+ title: checked ? "overlay visible to screen recorders" : "overlay hidden from screen recorders",
+ description: "press the shortcut to open the overlay with the new setting.",
+ });
+ }}
+ />
+ </div>
+ </CardContent>
+ </Card>
</div>
<div className="pt-4">
diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
index c00c7a9f0..5dec1920c 100644
--- a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
+++ b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
@@ -243,6 +243,7 @@ let DEFAULT_SETTINGS: Settings = {
},
enableUiEvents: false,
overlayMode: "fullscreen",
+ showOverlayInScreenRecording: false,
};
export function createDefaultSettingsObject(): Settings {
diff --git a/apps/screenpipe-app-tauri/lib/utils/tauri.ts b/apps/screenpipe-app-tauri/lib/utils/tauri.ts
index f07f82ae7..2c674be55 100644
--- a/apps/screenpipe-app-tauri/lib/utils/tauri.ts
+++ b/apps/screenpipe-app-tauri/lib/utils/tauri.ts
@@ -622,7 +622,7 @@ autoUpdate?: boolean;
* Timeline overlay mode: "fullscreen" (floating panel above everything) or
* "window" (normal resizable window with title bar).
*/
-overlayMode?: string }
+overlayMode?: string; showOverlayInScreenRecording?: boolean }
export type ShowRewindWindow = "Main" | { Settings: { page: string | null } } | { Search: { query: string | null } } | "Onboarding" | "Chat" | "PermissionRecovery"
/**
* Sync configuration.
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/store.rs b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
index ccd9da08c..4916f8f7f 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/store.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
@@ -211,6 +211,10 @@ pub struct SettingsStore {
/// "window" (normal resizable window with title bar).
#[serde(rename = "overlayMode", default = "default_overlay_mode")]
pub overlay_mode: String,
+ /// Allow screen recording apps to capture the overlay.
+ /// Disabled by default so the overlay doesn't appear in screenpipe's own recordings.
+ #[serde(rename = "showOverlayInScreenRecording", default)]
+ pub show_overlay_in_screen_recording: bool,
}
fn generate_device_id() -> String {
@@ -497,6 +501,7 @@ impl Default for SettingsStore {
enable_ui_events: false,
auto_update: true,
overlay_mode: "fullscreen".to_string(),
+ show_overlay_in_screen_recording: false,
}
}
}
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 e04d67ba1..e1c7117ee 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs
@@ -338,6 +338,11 @@ impl ShowRewindWindow {
/// Show an existing Main window (already created for the current mode).
fn show_existing_main(&self, app: &AppHandle, window: &WebviewWindow, overlay_mode: &str, label: &str) -> tauri::Result<WebviewWindow> {
+ let capturable = SettingsStore::get(app)
+ .unwrap_or_default()
+ .unwrap_or_default()
+ .show_overlay_in_screen_recording;
+
if overlay_mode == "window" {
info!("showing existing main window (window mode)");
#[cfg(target_os = "macos")]
@@ -348,11 +353,15 @@ impl ShowRewindWindow {
app.run_on_main_thread(move || {
if let Ok(panel) = app_clone.get_webview_panel(&lbl) {
use tauri_nspanel::cocoa::appkit::NSWindowCollectionBehavior;
+ use objc::{msg_send, sel, sel_impl};
panel.set_level(1001);
panel.set_collection_behaviour(
NSWindowCollectionBehavior::NSWindowCollectionBehaviorMoveToActiveSpace |
NSWindowCollectionBehavior::NSWindowCollectionBehaviorFullScreenAuxiliary
);
+ // Update screen capture sharing type
+ let sharing: u64 = if capturable { 1 } else { 0 };
+ let _: () = unsafe { msg_send![&*panel, setSharingType: sharing] };
panel.order_front_regardless();
let _ = app_clone.emit("window-focused", true);
}
@@ -405,6 +414,9 @@ impl ShowRewindWindow {
}
panel.set_level(1001);
let _: () = unsafe { objc::msg_send![&*panel, setMovableByWindowBackground: false] };
+ // Update screen capture sharing type
+ let sharing: u64 = if capturable { 1 } else { 0 };
+ let _: () = unsafe { objc::msg_send![&*panel, setSharingType: sharing] };
panel.set_collection_behaviour(
NSWindowCollectionBehavior::NSWindowCollectionBehaviorMoveToActiveSpace |
NSWindowCollectionBehavior::NSWindowCollectionBehaviorIgnoresCycle |
@@ -534,10 +546,11 @@ impl ShowRewindWindow {
}
// Read overlay mode from settings: "fullscreen" (panel) or "window" (normal)
- let overlay_mode = SettingsStore::get(app)
- .unwrap_or_default()
+ let settings = SettingsStore::get(app)
.unwrap_or_default()
- .overlay_mode;
+ .unwrap_or_default();
+ let overlay_mode = settings.overlay_mode;
+ let show_in_recording = settings.show_overlay_in_screen_recording;
// Record what mode we're creating so we can detect changes later
*MAIN_CREATED_MODE.lock().unwrap() = overlay_mode.clone();
let use_window_mode = overlay_mode == "window";
@@ -607,6 +620,7 @@ impl ShowRewindWindow {
if let Ok(_panel) = window.to_panel() {
info!("Converted window-mode main to panel");
let window_clone = window.clone();
+ let capturable = show_in_recording;
app.run_on_main_thread(move || {
use tauri_nspanel::cocoa::appkit::NSWindowCollectionBehavior;
use objc::{msg_send, sel, sel_impl};
@@ -618,8 +632,9 @@ impl ShowRewindWindow {
// Keep decorations! Don't call set_style_mask(0)
// Enable dragging by title bar (normal window behavior)
let _: () = unsafe { msg_send![&*panel, setMovableByWindowBackground: false] };
- // Exclude from screen capture
- let _: () = unsafe { msg_send![&*panel, setSharingType: 0_u64] };
+ // NSWindowSharingNone=0 hides from screen recorders, NSWindowSharingReadOnly=1 allows capture
+ let sharing: u64 = if capturable { 1 } else { 0 };
+ let _: () = unsafe { msg_send![&*panel, setSharingType: sharing] };
panel.set_collection_behaviour(
NSWindowCollectionBehavior::NSWindowCollectionBehaviorMoveToActiveSpace |
NSWindowCollectionBehavior::NSWindowCollectionBehaviorFullScreenAuxiliary
@@ -806,6 +821,7 @@ impl ShowRewindWindow {
// Set panel behaviors on main thread to avoid crashes
let window_clone = window.clone();
+ let capturable = show_in_recording;
app.run_on_main_thread(move || {
use tauri_nspanel::cocoa::appkit::{NSWindowCollectionBehavior};
@@ -823,9 +839,9 @@ impl ShowRewindWindow {
// Disable window dragging by clicking on background
let _: () = unsafe { msg_send![&*panel, setMovableByWindowBackground: false] };
- // Exclude from screen capture so the overlay doesn't appear
- // in screenshots of other apps (NSWindowSharingNone = 0)
- let _: () = unsafe { msg_send![&*panel, setSharingType: 0_u64] };
+ // NSWindowSharingNone=0 hides from screen recorders, NSWindowSharingReadOnly=1 allows capture
+ let sharing: u64 = if capturable { 1 } else { 0 };
+ let _: () = unsafe { msg_send![&*panel, setSharingType: sharing] };
panel.set_collection_behaviour(
NSWindowCollectionBehavior::NSWindowCollectionBehaviorMoveToActiveSpace |
@@ -966,8 +982,13 @@ impl ShowRewindWindow {
// Enable dragging by clicking anywhere on the window background
let _: () = unsafe { msg_send![&*panel, setMovableByWindowBackground: true] };
- // Exclude from screen capture (NSWindowSharingNone = 0)
- let _: () = unsafe { msg_send![&*panel, setSharingType: 0_u64] };
+ // NSWindowSharingNone=0 hides from screen recorders, NSWindowSharingReadOnly=1 allows capture
+ let capturable = SettingsStore::get(window_clone.app_handle())
+ .unwrap_or_default()
+ .unwrap_or_default()
+ .show_overlay_in_screen_recording;
+ let sharing: u64 = if capturable { 1 } else { 0 };
+ let _: () = unsafe { msg_send![&*panel, setSharingType: sharing] };
panel.set_collection_behaviour(
NSWindowCollectionBehavior::NSWindowCollectionBehaviorMoveToActiveSpace |