fix(linux): startup crash — click-through toggle aborts on unrealized GTK window#906
Open
jboero wants to merge 1 commit into
Open
fix(linux): startup crash — click-through toggle aborts on unrealized GTK window#906jboero wants to merge 1 commit into
jboero wants to merge 1 commit into
Conversation
…tup crash 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 <noreply@anthropic.com>
Contributor
📝 WalkthroughWalkthroughLinux builds now skip Tauri cursor-event configuration during dictate window startup, display, and hide handling. Non-Linux behavior remains unchanged. ChangesLinux cursor-event guards
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Author
|
Sorry is docstring coverage really a hard stop for a segfault fix? |
Author
|
Thank you CodeRabbit 🤣 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Linux, Voicebox aborts (SIGABRT) within seconds of launch, on both Wayland and X11:
Cause
The dictate pill window is built hidden at setup (
.visible(false)), so GTK never realizes it — it has no underlyingGdkWindow. As soon as the pill webview mounts, the frontend emitsdictate:hide(DictateWindow.tsx enters thehiddenstate), and the Rust handler callswindow.set_ignore_cursor_events(true). tao'sWindowRequest::CursorIgnoreEventspath doeswindow.window().unwrap()on the unrealized window →None→ panic inside a glib dispatch that cannot unwind → process abort.This affects every Linux user at startup; the realization behavior is identical on X11 and Wayland.
Fix
Gate the three
set_ignore_cursor_eventscall sites behind#[cfg(not(target_os = "linux"))]. The click-through toggle exists as a macOS workaround (transparent always-on-top NSWindows lingering as invisible click targets — see the existing comments); on GTK,hide()unmaps the window and unmapped windows can't receive input, and the window is parked at (-10_000, -10_000) besides. Gating both thetrueandfalsecalls keeps the state balanced: never set, never needs unsetting.macOS and Windows compile byte-identical code to before — zero behavior change outside Linux.
Testing
/health, and runs through TTS generation without the abort.A cleaner long-term fix would be tao handling unrealized windows gracefully in
CursorIgnoreEventsinstead of unwrapping; this PR is the pragmatic app-level fix.🤖 Generated with Claude Code
Related issues
Fixes #873 (same crash, same diagnosis —
set_ignore_cursor_eventson the transparent dictate window, tao 0.34.5event_loop.rs:449).Fixes #680 (same panic at startup on Kubuntu 24.04 / X11 — confirms this is not Wayland-specific).
Likely also resolves #803 (same unwrap in tao 0.35.3 at its shifted line 457, reported as Wayland+NVIDIA — worth a retest with this patch rather than auto-closing).
Summary by CodeRabbit