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: crash when clicking overlay reminder during a11y hit test

Louis Beaumont676636574d26
diff --git a/apps/screenpipe-app-tauri/src-tauri/swift/shortcut_reminder.swift b/apps/screenpipe-app-tauri/src-tauri/swift/shortcut_reminder.swift
index bd7d99045..df7c335bf 100644
--- a/apps/screenpipe-app-tauri/src-tauri/swift/shortcut_reminder.swift
+++ b/apps/screenpipe-app-tauri/src-tauri/swift/shortcut_reminder.swift
@@ -189,6 +189,7 @@ struct ShortcutReminderView: View {
.transition(.opacity.combined(with: .scale(scale: 1.2, anchor: .trailing)))
}
}
+ .accessibilityHidden(true)
.animation(.easeInOut(duration: kAnimDur), value: isExpanded)
.onHover { hovering in
isExpanded = hovering
diff --git a/crates/screenpipe-a11y/src/platform/macos.rs b/crates/screenpipe-a11y/src/platform/macos.rs
index 9505cd241..88dee3fe4 100644
--- a/crates/screenpipe-a11y/src/platform/macos.rs
+++ b/crates/screenpipe-a11y/src/platform/macos.rs
@@ -968,6 +968,14 @@ fn get_element_at_position(x: f64, y: f64, config: &UiCaptureConfig) -> Option<E
let sys = ax::UiElement::sys_wide();
let elem = sys.element_at_pos(x as f32, y as f32).ok()?;
+ // Skip elements belonging to our own process to avoid crashes when querying
+ // our overlay views (e.g. shortcut reminder) that may be mid-dismissal
+ if let Ok(pid) = elem.pid() {
+ if pid == std::process::id() as i32 {
+ return None;
+ }
+ }
+
let role = elem.role().ok().map(|r| {
let s = format!("{:?}", r);
if let Some(start) = s.find("AX") {