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: ignore minimized windows during capture (#1788)

MohamedAmineOualid7f4b43c5e3e
diff --git a/screenpipe-vision/src/capture_screenshot_by_window.rs b/screenpipe-vision/src/capture_screenshot_by_window.rs
index c249ae7f5..68fad28fb 100644
--- a/screenpipe-vision/src/capture_screenshot_by_window.rs
+++ b/screenpipe-vision/src/capture_screenshot_by_window.rs
@@ -219,6 +219,20 @@ pub async fn capture_all_visible_windows(
}
};
+ match window.is_minimized() {
+ Ok(is_minimized) => {
+ if is_minimized {
+ debug!("Window {} ({}) is_minimized", app_name, title);
+ return None;
+ }
+ },
+ Err(e) => {
+ // Log warning and skip this window
+ // mostly noise
+ error!("Failed to get is_minimized for window {}: {}", app_name, e);
+ }
+ };
+
let is_focused = match window.is_focused() {
Ok(focused) => focused,
Err(e) => {