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: fully block ignored windows from all capture paths (v2.3.60)

Louis Beaumont449ae7a6885c
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index 9538ae10f..d6cea42a8 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -9671,7 +9671,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.3.54"
+version = "2.3.58"
dependencies = [
"anyhow",
"arboard",
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index 01c5cde0d..94ba3b550 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.3.59"
+version = "2.3.60"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/crates/screenpipe-engine/src/event_driven_capture.rs b/crates/screenpipe-engine/src/event_driven_capture.rs
index 963f2cca9..bd56000c3 100644
--- a/crates/screenpipe-engine/src/event_driven_capture.rs
+++ b/crates/screenpipe-engine/src/event_driven_capture.rs
@@ -908,6 +908,33 @@ async fn do_capture(
TreeWalkResult::NotFound => None,
};
+ // Safety net: when the tree walk returned NotFound (AX failure, budget skip,
+ // etc.) the Skipped(UserIgnored) path didn't fire. If the focused app still
+ // matches an ignored-window pattern, bail out now to prevent OCR from
+ // capturing text from an excluded window (e.g. startup capture while
+ // Bitwarden is focused but AX hadn't initialized yet).
+ if tree_snapshot.is_none() {
+ if let Some(ref app) = trigger_app {
+ let app_lower = app.to_lowercase();
+ if params
+ .tree_walker_config
+ .ignored_windows
+ .iter()
+ .any(|ig| app_lower.contains(&ig.to_lowercase()))
+ {
+ debug!(
+ "skipping capture: focused app '{}' matches ignored window on monitor {} (tree walk was NotFound)",
+ app, params.monitor_id
+ );
+ return Ok(CaptureOutput {
+ result: None,
+ image,
+ elements_deduped: false,
+ });
+ }
+ }
+ }
+
// Content dedup: skip capture if accessibility text hasn't changed.
// Never dedup Idle/Manual triggers — these are fallback captures that must
// always write so the timeline is never completely empty.
@@ -984,6 +1011,29 @@ async fn do_capture(
});
}
+ // Final ignored-window gate: check resolved metadata (app + window) against
+ // ignored patterns. This catches edge cases where the tree walk succeeded but
+ // didn't return Skipped (e.g. the trigger carried the app name, not the tree).
+ {
+ let check_app = app_name_owned.as_deref().unwrap_or_default().to_lowercase();
+ let check_win = window_name_owned.as_deref().unwrap_or_default().to_lowercase();
+ if params.tree_walker_config.ignored_windows.iter().any(|ig| {
+ let ig_lower = ig.to_lowercase();
+ (!check_app.is_empty() && check_app.contains(&ig_lower))
+ || (!check_win.is_empty() && check_win.contains(&ig_lower))
+ }) {
+ debug!(
+ "skipping capture: resolved app='{}' / window='{}' matches ignored pattern on monitor {}",
+ check_app, check_win, params.monitor_id
+ );
+ return Ok(CaptureOutput {
+ result: None,
+ image,
+ elements_deduped: false,
+ });
+ }
+ }
+
// DRM content detection: check if the focused app/URL is a streaming service.
// When detected, set the global pause flag so ALL monitors stop capture
// and the monitor watcher releases all SCK handles.
diff --git a/crates/screenpipe-engine/src/ui_recorder.rs b/crates/screenpipe-engine/src/ui_recorder.rs
index 9da551d99..d37d1938c 100644
--- a/crates/screenpipe-engine/src/ui_recorder.rs
+++ b/crates/screenpipe-engine/src/ui_recorder.rs
@@ -316,7 +316,24 @@ pub async fn start_ui_recording(
}
if record_input_events {
- batch.push(db_event);
+ // Don't store input events from ignored windows/apps
+ let app_lower = db_event
+ .app_name
+ .as_deref()
+ .unwrap_or_default()
+ .to_lowercase();
+ let title_lower = db_event
+ .window_title
+ .as_deref()
+ .unwrap_or_default()
+ .to_lowercase();
+ let is_ignored = ignored_windows.iter().any(|ig| {
+ let ig_lower = ig.to_lowercase();
+ app_lower.contains(&ig_lower) || title_lower.contains(&ig_lower)
+ });
+ if !is_ignored {
+ batch.push(db_event);
+ }
}
// Flush if batch is full