diff --git a/tauri/src-tauri/src/hotkey_monitor.rs b/tauri/src-tauri/src/hotkey_monitor.rs index 280a0462..1510ed2c 100644 --- a/tauri/src-tauri/src/hotkey_monitor.rs +++ b/tauri/src-tauri/src/hotkey_monitor.rs @@ -264,6 +264,9 @@ fn apply_effect(app: &AppHandle, effect: Effect) { let _ = window.set_position(tauri::PhysicalPosition::new(x, y)); } } + // Skip on Linux: aborts if the window was never realized + // (see show_dictate_window in main.rs). + #[cfg(not(target_os = "linux"))] let _ = window.set_ignore_cursor_events(false); // Deliberately no set_focus() — taking key focus would yank // it out of whatever app the user was typing in, which is diff --git a/tauri/src-tauri/src/main.rs b/tauri/src-tauri/src/main.rs index a17d217a..337d2b8a 100644 --- a/tauri/src-tauri/src/main.rs +++ b/tauri/src-tauri/src/main.rs @@ -244,6 +244,10 @@ pub fn show_dictate_window(app: &tauri::AppHandle) { let _ = window.set_position(PhysicalPosition::new(x, y)); } } + // Skip on Linux: tao's CursorIgnoreEvents handler unwraps the GdkWindow, + // which is None until the window is first shown, aborting the process. + // The click-through toggle is a macOS workaround and is never set on Linux. + #[cfg(not(target_os = "linux"))] let _ = window.set_ignore_cursor_events(false); let _ = window.show(); #[cfg(target_os = "macos")] @@ -1597,6 +1601,9 @@ pub fn run() { let handle_for_hide = app.handle().clone(); app.handle().listen("dictate:hide", move |_event| { if let Some(window) = handle_for_hide.get_webview_window(DICTATE_WINDOW_LABEL) { + // Skip on Linux: aborts if the window was never realized + // (see show_dictate_window). + #[cfg(not(target_os = "linux"))] let _ = window.set_ignore_cursor_events(true); let _ = window.set_position(PhysicalPosition::new(-10_000, -10_000)); let _ = window.hide();