fix(linux): skip click-through toggle on dictate pill to prevent startup crash (#906)

The dictate pill window is built hidden at setup and the frontend emits
dictate:hide as soon as it mounts. The handler calls
set_ignore_cursor_events(true) on a window GTK has never realized, and
tao's CursorIgnoreEvents path unwraps the missing GdkWindow
(tao-0.34.5 event_loop.rs:449), panicking inside a glib dispatch that
cannot unwind — the process aborts within seconds of launch on Linux.

The click-through toggle exists as a macOS workaround for transparent
always-on-top NSWindows lingering as invisible click targets; it was
never needed on Linux. Gate all three call sites so Linux never toggles
it: the true/false pair stays balanced (never set, never unset), and
macOS/Windows builds are unchanged.

Co-authored-by: Claude Fable 5 <[email protected]>
This commit is contained in:
Johnny Boero
2026-07-20 12:40:10 -07:00
committed by GitHub
co-authored by Claude Fable 5
parent 2c9d02af62
commit 4a6b5da793
2 changed files with 10 additions and 0 deletions
+3
View File
@@ -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
+7
View File
@@ -112,6 +112,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();
}
@@ -1421,6 +1425,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();