Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions app/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ mod meet_call;
mod meet_scanner;
mod meet_video;
mod native_notifications;
#[cfg(target_os = "macos")]
mod notch_window;
mod notification_settings;
mod process_kill;
mod process_recovery;
Expand Down Expand Up @@ -927,6 +929,33 @@ fn mascot_native_window_is_open() -> bool {
false
}

/// Show the notch activity indicator. macOS only — transparent NSPanel + WKWebView
/// anchored to the top-centre of the primary screen. Displays live voice and
/// agent status (listening, thinking, executing) in a pill that emerges from
/// the physical notch on supported MacBook Pros.
#[tauri::command]
fn notch_window_show(app: AppHandle<AppRuntime>) -> Result<(), String> {
log::info!("[notch-window] show requested");
#[cfg(target_os = "macos")]
{
return notch_window::show(&app);
}
#[cfg(not(target_os = "macos"))]
{
let _ = app;
Ok(()) // No-op on non-macOS
}
}

/// Hide the notch activity indicator.
#[tauri::command]
fn notch_window_hide(_app: AppHandle<AppRuntime>) -> Result<(), String> {
log::info!("[notch-window] hide requested");
#[cfg(target_os = "macos")]
notch_window::hide();
Ok(())
}

/// Hide or show the OS top-level main-window frame on Windows by enumerating
/// this process's top-level windows and matching the visible
/// `Chrome_WidgetWin_1` host. `WebviewWindow::hwnd()` from the vendored CEF
Expand Down Expand Up @@ -2800,6 +2829,14 @@ pub fn run() {
// let _ = window.show();
// }

// Notch activity indicator: transparent pill at the top-centre of
// the primary screen. Shows live voice / agent state. macOS only
// (physical notch or menu-bar HUD on older hardware).
#[cfg(target_os = "macos")]
if let Err(err) = notch_window::show(&app.handle()) {
log::warn!("[notch-window] auto-show on startup failed: {err}");
}

// Synthetic-input main-thread executor. enigo's macOS keyboard-layout
// lookup (TSMGetInputSourceProperty) MUST run on the app main thread
// or it traps (`_dispatch_assert_queue_fail`/EXC_BREAKPOINT) and
Expand Down Expand Up @@ -3195,6 +3232,8 @@ pub fn run() {
native_notifications::show_native_notification,
mascot_window_show,
mascot_window_hide,
notch_window_show,
notch_window_hide,
file_logging::reveal_logs_folder,
file_logging::logs_folder_path,
workspace_paths::open_workspace_path,
Expand Down
Loading
Loading