pub const LENSED: bool = cfg!(any(target_os = "macos", target_family = "wasm"));
pub fn frosted_window() -> bool {
#[cfg(target_os = "windows")]
{
static MICA: std::sync::OnceLock<bool> = std::sync::OnceLock::new();
*MICA.get_or_init(|| windows::build() >= windows::MICA_BUILD)
}
#[cfg(not(target_os = "windows"))]
{
cfg!(any(target_os = "macos", target_family = "wasm"))
}
}
#[cfg(target_os = "windows")]
mod windows {
use windows_sys::{
Wdk::System::SystemServices::RtlGetVersion,
Win32::System::SystemInformation::OSVERSIONINFOW,
};
pub(super) const MICA_BUILD: u32 = 22621;
pub(super) fn build() -> u32 {
let mut version = OSVERSIONINFOW {
dwOSVersionInfoSize: size_of::<OSVERSIONINFOW>() as u32,
..Default::default()
};
if unsafe { RtlGetVersion(&mut version) } < 0 {
return 0;
}
version.dwBuildNumber
}
}