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

release-app: fix capture_unfocused_windows arg, remove dead code

Louis Beaumont556f9bdca4d7
diff --git a/Cargo.toml b/Cargo.toml
index 2fd0e722e..9854b6c56 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,9 +11,8 @@ members = [
exclude = ["screenpipe-app-tauri/src-tauri"]
resolver = "2"
-
[workspace.package]
-version = "0.2.48"
+version = "0.2.49"
authors = ["louis030195 <[email protected]>"]
description = ""
repository = "https://github.com/mediar-ai/screenpipe"
diff --git a/screenpipe-actions/src/screenshot.rs b/screenpipe-actions/src/screenshot.rs
deleted file mode 100644
index 3510f1a18..000000000
--- a/screenpipe-actions/src/screenshot.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// use anyhow::Result;
-// use image::DynamicImage;
-// use screenshots::Screen;
-
-// Commented out unused function
-// pub fn capture_main_window_screenshot() -> Result<DynamicImage> {
-// // ... existing code ...
-// }
-
-// Commented out unused function
-// fn is_valid_window(window: &Window) -> bool {
-// let title = window.title().unwrap_or_default();
-// let class = window.class().unwrap_or_default();
-//
-// !title.is_empty() && !class.is_empty() && title != "Desktop" && class != "Desktop"
-// }
-
-// If there are any other functions or code in this file, keep them as is
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.toml
index 693a6c82c..14174a0c1 100644
--- a/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "0.33.7"
+version = "0.33.8"
description = ""
authors = ["you"]
license = ""
diff --git a/screenpipe-vision/src/capture_screenshot_by_window.rs b/screenpipe-vision/src/capture_screenshot_by_window.rs
index 3eb306442..2cb225cf3 100644
--- a/screenpipe-vision/src/capture_screenshot_by_window.rs
+++ b/screenpipe-vision/src/capture_screenshot_by_window.rs
@@ -203,7 +203,7 @@ pub async fn capture_all_visible_windows(
let app_name = window.app_name().to_string();
let title = window.title().to_string();
let is_focused = window.is_focused();
-
+
// Capture image immediately while we have access to the window
match window.capture_image() {
Ok(buffer) => Some((app_name, title, is_focused, buffer)),
@@ -220,18 +220,14 @@ pub async fn capture_all_visible_windows(
for (app_name, window_name, is_focused, buffer) in windows_data {
// Convert to DynamicImage
let image = DynamicImage::ImageRgba8(
- image::ImageBuffer::from_raw(
- buffer.width(),
- buffer.height(),
- buffer.into_raw(),
- )
- .unwrap(),
+ image::ImageBuffer::from_raw(buffer.width(), buffer.height(), buffer.into_raw())
+ .unwrap(),
);
// Apply filters
- let is_valid = !SKIP_APPS.contains(app_name.as_str())
+ let is_valid = !SKIP_APPS.contains(app_name.as_str())
&& !SKIP_TITLES.contains(window_name.as_str())
- && (!capture_unfocused_windows || (is_focused && monitor.id() == monitor.id()))
+ && (capture_unfocused_windows || (is_focused && monitor.id() == monitor.id()))
&& window_filters.is_valid(&app_name, &window_name);
if is_valid {
@@ -246,28 +242,3 @@ pub async fn capture_all_visible_windows(
Ok(all_captured_images)
}
-
-pub fn is_valid_window(
- window: &Window,
- monitor: &SafeMonitor,
- filters: &WindowFilters,
- capture_unfocused_windows: bool,
-) -> bool {
- if !capture_unfocused_windows {
- let is_focused = window.current_monitor().id() == monitor.id() && window.is_focused();
-
- if !is_focused {
- return false;
- }
- }
-
- // Fast O(1) lookups using HashSet
- let app_name = window.app_name();
- let title = window.title();
-
- if SKIP_APPS.contains(app_name) || SKIP_TITLES.contains(title) {
- return false;
- }
-
- filters.is_valid(app_name, title)
-}