From ac32253cd7f621f7608dbe24b1745eac314fc537 Mon Sep 17 00:00:00 2001 From: "flamingo[bot]" <277372822+flamingo[bot]@users.noreply.github.com> Date: Mon, 7 Sep 2026 05:04:08 +0000 Subject: [PATCH] fix(OPENFRAM-003-13): 2 review findings in windows_activator.rs --- src-tauri/src/windows_activator.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src-tauri/src/windows_activator.rs b/src-tauri/src/windows_activator.rs index e8742a2..cd5de97 100644 --- a/src-tauri/src/windows_activator.rs +++ b/src-tauri/src/windows_activator.rs @@ -19,6 +19,14 @@ // what toasts are posted under) but has no property for the activator. The // AppUserModelId key supplies it, and doubles as the AUMID registration for dev // builds, which have no shortcut at all. +// +// This whole file is Windows-only: it is registered from `lib.rs` behind +// `#[cfg(target_os = "windows")]` on the `mod windows_activator;` declaration, +// which is what keeps the `windows` crate dependency and every item below out +// of non-Windows builds. The guard is asserted here too so this file cannot +// silently compile (and fail) on another platform if that `mod` guard is ever +// removed or edited. +#![cfg(target_os = "windows")] use std::ffi::c_void; use std::sync::OnceLock; @@ -64,6 +72,7 @@ static ROUTER: OnceLock = OnceLock::new(); /// nothing, so COM never routes an activation into one that is about to exit. pub(crate) fn init(app: &AppHandle) { if ROUTER.set(app.clone()).is_err() { + log::warn!("[notifications] toast activator router already initialized — skipping re-init"); return; } register(app); @@ -287,3 +296,4 @@ impl IClassFactory_Impl for ActivatorFactory_Impl { Ok(()) } } +