diff --git a/Cargo.lock b/Cargo.lock index c28aa7f55a..02dbda7c4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1284,6 +1284,7 @@ dependencies = [ "tokio", "tracing", "windows 0.58.0", + "windows-core 0.58.0", ] [[package]] diff --git a/apps/desktop/src/components/main/body/sessions/index.tsx b/apps/desktop/src/components/main/body/sessions/index.tsx index 1d09374d65..d6733af21e 100644 --- a/apps/desktop/src/components/main/body/sessions/index.tsx +++ b/apps/desktop/src/components/main/body/sessions/index.tsx @@ -264,6 +264,7 @@ function TabContentNoteInner({ ); @@ -272,9 +273,11 @@ function TabContentNoteInner({ function StatusBanner({ skipReason, showConsentBanner, + showTimeline, }: { skipReason: string | null; showConsentBanner: boolean; + showTimeline: boolean; }) { const { leftsidebar, chat } = useShell(); const [chatPanelWidth, setChatPanelWidth] = useState(0); @@ -329,9 +332,10 @@ function StatusBanner({ transition={{ duration: 0.3, ease: "easeOut" }} style={{ left: `calc(50% + ${totalOffset}px)` }} className={cn([ - "fixed -translate-x-1/2 bottom-6 z-50", + "fixed -translate-x-1/2 z-50", "whitespace-nowrap text-center text-xs", skipReason ? "text-red-400" : "text-stone-300", + showTimeline ? "bottom-[76px]" : "bottom-6", ])} > {skipReason || "Ask for consent when using Hyprnote"} diff --git a/apps/web/src/routeTree.gen.ts b/apps/web/src/routeTree.gen.ts index 413b094d8a..9aa3380291 100644 --- a/apps/web/src/routeTree.gen.ts +++ b/apps/web/src/routeTree.gen.ts @@ -2583,8 +2583,6 @@ declare module '@tanstack/react-router' { fullPath: '/api/admin/kanban/create' preLoaderRoute: typeof ApiAdminKanbanCreateRouteImport parentRoute: typeof rootRouteImport - } - parentRoute: typeof rootRouteImport } '/api/admin/import/google-docs': { id: '/api/admin/import/google-docs' diff --git a/crates/audio-device/Cargo.toml b/crates/audio-device/Cargo.toml index 0d6961f865..96a9864c74 100644 --- a/crates/audio-device/Cargo.toml +++ b/crates/audio-device/Cargo.toml @@ -17,7 +17,8 @@ cidre = { workspace = true, features = ["av"] } libpulse-binding = "2.30.1" [target.'cfg(target_os = "windows")'.dependencies] -windows = { version = "0.58", features = ["Win32_Media_Audio", "Win32_System_Com", "Win32_UI_Shell_PropertiesSystem", "Win32_Devices_FunctionDiscovery"] } +windows = { version = "0.58", features = ["Win32_Media_Audio", "Win32_Media_Audio_Endpoints", "Win32_System_Com", "Win32_UI_Shell_PropertiesSystem", "Win32_Devices_FunctionDiscovery"] } +windows-core = "0.58" [dev-dependencies] tokio = { workspace = true, features = ["rt", "macros"] } diff --git a/crates/audio-device/src/windows.rs b/crates/audio-device/src/windows.rs index 6d2762d27b..d0acd81fc7 100644 --- a/crates/audio-device/src/windows.rs +++ b/crates/audio-device/src/windows.rs @@ -3,9 +3,10 @@ use std::ffi::OsString; use std::os::windows::ffi::OsStringExt; use windows::Win32::Devices::FunctionDiscovery::PKEY_Device_FriendlyName; use windows::Win32::Media::Audio::{ - DEVICE_STATE_ACTIVE, Endpoints, IAudioEndpointVolume, IMMDevice, IMMDeviceEnumerator, - MMDeviceEnumerator, eAll, eCapture, eConsole, eRender, + DEVICE_STATE_ACTIVE, IMMDevice, IMMDeviceEnumerator, MMDeviceEnumerator, eAll, eCapture, + eConsole, eRender, }; +use windows::Win32::Media::Audio::Endpoints::IAudioEndpointVolume; use windows::Win32::System::Com::{ CLSCTX_ALL, COINIT_MULTITHREADED, CoCreateInstance, CoInitializeEx, CoUninitialize, STGM_READ, }; @@ -78,7 +79,7 @@ struct ComGuard; impl ComGuard { fn new() -> Result { unsafe { - CoInitializeEx(None, COINIT_MULTITHREADED).map_err(|e| { + CoInitializeEx(None, COINIT_MULTITHREADED).ok().map_err(|e| { Error::AudioSystemError(format!("COM initialization failed: {}", e)) })?; } @@ -122,18 +123,12 @@ fn get_device_name(device: &IMMDevice) -> Result { .GetValue(&PKEY_Device_FriendlyName) .map_err(|e| Error::EnumerationFailed(format!("Failed to get device name: {}", e)))?; - let name = prop.Anonymous.Anonymous.Anonymous.pwszVal; - if name.is_null() { + let name = prop.to_string(); + if name.is_empty() { return Err(Error::EnumerationFailed("Device name is null".into())); } - let len = (0..).take_while(|&i| *name.add(i) != 0).count(); - let slice = std::slice::from_raw_parts(name, len); - let os_string = OsString::from_wide(slice); - - os_string - .into_string() - .map_err(|_| Error::EnumerationFailed("Invalid device name encoding".into())) + Ok(name) } } @@ -355,6 +350,7 @@ impl AudioDeviceBackend for WindowsBackend { for role in 0..3u32 { policy_config .SetDefaultEndpoint(PCWSTR(device_id_wide.as_ptr()), role) + .ok() .map_err(|e| { Error::SetDefaultFailed(format!("Failed to set default endpoint: {}", e)) })?;