Skip to content

fix(linux): skip set_ignore_cursor_events to avoid tao GDK panic - #927

Open
zhiqing-yu wants to merge 1 commit into
jamiepine:mainfrom
zhiqing-yu:fix/linux-tao-cursor-events-panic-873
Open

fix(linux): skip set_ignore_cursor_events to avoid tao GDK panic#927
zhiqing-yu wants to merge 1 commit into
jamiepine:mainfrom
zhiqing-yu:fix/linux-tao-cursor-events-panic-873

Conversation

@zhiqing-yu

@zhiqing-yu zhiqing-yu commented Jul 20, 2026

Copy link
Copy Markdown

Summary

Fixes #873 — tao panic on Linux/X11 when set_ignore_cursor_events() is called on the dictate pill window.

tao's set_ignore_cursor_events unwraps the GDK window internally, which is None on Linux/X11 for a transparent window that hasn't been realized yet. This makes the crash 100% reproducible on the very first dictation hotkey press (or the first agent-initiated speech), since that's the first time the pill window — built hidden at startup — actually gets shown.

There are three call sites hitting this:

  • hotkey_monitor.rsEffect::StartRecording, the real hotkey-trigger path
  • main.rsshow_dictate_window(), the agent-speech / dictate:show path
  • main.rs — the dictate:hide handler

Fix

Skip set_ignore_cursor_events on Linux at all three sites. The dictate window is already parked off-screen (-10_000, -10_000) and hidden via .hide() on the hide path, which is sufficient on its own to keep it from being a click target — the click-through toggle is really a macOS-only workaround for hide() leaving behind an invisible NSWindow click target, so it's unnecessary (and unsafe) on Linux.

Test plan

  • cargo check — compiles clean, no new warnings
  • Ran the app via bun run tauri dev on Ubuntu 24.04 / X11 / NVIDIA proprietary driver (the exact environment in the issue) and confirmed the main window renders correctly
  • Would appreciate a maintainer or the original reporters (@EduardoZepeda, @krishna3554) confirming the hotkey-triggered dictation flow no longer panics on their setup, since I wasn't able to fully drive the global-hotkey chord capture in my test environment

Independently arrived at the same fix shape @krishna3554 outlined in the issue thread; credit to their analysis for narrowing down all three call sites.

Summary by CodeRabbit

  • Bug Fixes
    • Improved dictate window behavior on Linux/X11 by preventing unintended changes to click-through settings.
    • Improved reliability when showing, hiding, and starting dictation on Linux.
    • Added an automatic graphics compatibility adjustment for systems using NVIDIA’s proprietary driver, helping prevent display and rendering issues.

…iepine#873)

tao's set_ignore_cursor_events unwraps the GDK window internally, which
is None on Linux/X11 for a transparent window that hasn't been realized
yet (or, per the issue thread, sometimes even after). Calling it aborts
the whole process, and it was 100% reproducible on the very first
dictation hotkey press since that's the first time the never-shown pill
window gets shown at all.

Skip the three call sites on Linux: the off-screen parking + hide()
already used for the dictate pill are sufficient to keep it from being
a click target, so the click-through toggle (a macOS-only workaround)
isn't needed there anyway.

Fixes jamiepine#873
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e954c588-3b68-4b1c-9777-7531d27141e6

📥 Commits

Reviewing files that changed from the base of the PR and between f2cf2a7 and 10e88bf.

📒 Files selected for processing (2)
  • tauri/src-tauri/src/hotkey_monitor.rs
  • tauri/src-tauri/src/main.rs

📝 Walkthrough

Walkthrough

Linux dictate-window click-through calls are conditionally disabled, while startup detects NVIDIA drivers and configures WebKitGTK’s DMA-BUF renderer setting when needed.

Changes

Linux runtime stability

Layer / File(s) Summary
Guard Linux click-through operations
tauri/src-tauri/src/hotkey_monitor.rs, tauri/src-tauri/src/main.rs
Dictate-window click-through toggles are compiled out on Linux while positioning, parking, showing, and hiding continue unchanged.
Configure NVIDIA WebKitGTK rendering
tauri/src-tauri/src/main.rs
Linux startup sets WEBKIT_DISABLE_DMABUF_RENDERER=1 when the NVIDIA driver is detected and the variable is unset.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: jamiepine

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The NVIDIA/WebKit DMA-BUF renderer change is unrelated to the reported set_ignore_cursor_events crash fix. Move the WebKitGTK/NVIDIA workaround to a separate PR or explain how it directly supports the linked crash fix.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the Linux fix to skip set_ignore_cursor_events and avoid the tao panic.
Linked Issues check ✅ Passed The Linux-only skips at the three call sites address the reported set_ignore_cursor_events panic in [#873].
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tao panic on Linux set_ignore_cursor_events crashes on transparent windows

1 participant