Skip to content

Panic on Linux when calling set_ignore_cursor_events during app setup. #143

Closed

Description

@Nurysso

In Tauri v2 on Linux, calling set_ignore_cursor_events() on a window before its underlying native display surface has been realized/mapped causes an unhandled panic inside TAO src/platform_impl/linux/event_loop.rs.

Specifically, TAO's WindowRequest::CursorIgnoreEvents handler attempts to query window.window() (which returns None prior to the window being drawn) and calls .unwrap() on it.

Check window.is_visible() to ensure the window is realized before requesting GTK to ignore cursor events:

pub fn set_interactive(app: &AppHandle, interactive: bool) {
    if let Some(window) = app.get_webview_window(LABEL) {
        if window.is_visible().unwrap_or(false) {
            let _ = window.set_ignore_cursor_events(!interactive);
        }
    }
}

this got the app to render but the backend isn't active so didn't tested it further,

Activity

  1. Nurysso commented on Sep 17, 2026

    @Nurysso
    Author

    This is irrespective of GTK of QT as it originates from tao GTK event loop when tries to fetch the native GDK surface pointer because GTK hasn't finished mapping window surface to display server yet it returns none, causing panic at unwrap() in src/platform_impl/linux/event_loop.rs:457.

    From what i understand by reading the tao's code this is a low-level safety bug in tao's GTK implementation on linux as it assumes a created GtkWindow widget always has a initialized GdkWindow surface attached to it

  2. changed the title [-]Panic on Linux when calling set_ignore_cursor_events during app setup (Linux/GTK)[/-] [+]Panic on Linux when calling set_ignore_cursor_events during app setup (Linux)[/+] on Sep 17, 2026
  3. changed the title [-]Panic on Linux when calling set_ignore_cursor_events during app setup (Linux)[/-] [+]Panic on Linux when calling set_ignore_cursor_events during app setup.[/+] on Sep 17, 2026
  4. karansinghgit commented on Sep 22, 2026

    @karansinghgit
    Owner

    Fixed in #147, now on main. The guard lives in pill::set_interactive itself rather than at each call site, so any future caller is covered too.

    You're right that it's a bug in tao: it assumes a created GtkWindow always has a GdkWindow attached. Guarding on our side is the practical fix while that stands. Thanks both for the detail here.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions