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(macos): order_out notification-panel and shortcut-reminder on hide to prevent ghost click interception

Louis Beaumont32fed7c8c77c
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs b/apps/screenpipe-app-tauri/src-tauri/src/commands.rs
index 84a0c1af4..2197d9214 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/commands.rs
@@ -1002,6 +1002,20 @@ pub async fn show_shortcut_reminder(
pub async fn hide_shortcut_reminder(app_handle: tauri::AppHandle) -> Result<(), String> {
if let Some(window) = app_handle.get_webview_window("shortcut-reminder") {
let _ = window.hide();
+
+ // On macOS, window.hide() alone doesn't remove NSPanel from the hit-test
+ // hierarchy when NSNonactivatingPanelMask is set. order_out ensures the
+ // panel is fully removed so it can't intercept clicks on other apps.
+ #[cfg(target_os = "macos")]
+ {
+ use tauri_nspanel::ManagerExt;
+ let app_clone = app_handle.clone();
+ let _ = app_handle.run_on_main_thread(move || {
+ if let Ok(panel) = app_clone.get_webview_panel("shortcut-reminder") {
+ panel.order_out(None);
+ }
+ });
+ }
}
Ok(())
}
@@ -1185,6 +1199,20 @@ pub async fn show_notification_panel(
pub async fn hide_notification_panel(app_handle: tauri::AppHandle) -> Result<(), String> {
if let Some(window) = app_handle.get_webview_window("notification-panel") {
let _ = window.hide();
+
+ // On macOS, window.hide() alone doesn't remove NSPanel from the hit-test
+ // hierarchy when NSNonactivatingPanelMask is set. order_out ensures the
+ // panel is fully removed so it can't intercept clicks on other apps.
+ #[cfg(target_os = "macos")]
+ {
+ use tauri_nspanel::ManagerExt;
+ let app_clone = app_handle.clone();
+ let _ = app_handle.run_on_main_thread(move || {
+ if let Ok(panel) = app_clone.get_webview_panel("notification-panel") {
+ panel.order_out(None);
+ }
+ });
+ }
}
Ok(())
}