Skip to content

[bug] @tauri-apps/plugin-dialog dialog is called in tauri::async_runtime, and the pop-up window does not have the screen centered #2236

Open
@persiliao

Description

@persiliao

Describe the bug

When I call dialog in tauri::async_runtime in an async process, the pop-up window doesn't have the screen centered
Xnapper-2024-12-23-15 51 31

Reproduction

tauri::async_runtime::spawn(async move {
    app
    .dialog()
    .message(format!("No valid {} found.", command_type))
    .kind(MessageDialogKind::Error)
    .title("Failed to start")
    .blocking_show();
})

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Mac OS 15.1.1 x86_64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.83.0 (90b35a623 2024-11-26)
    ✔ cargo: 1.83.0 (5ffbef321 2024-10-29)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-x86_64-apple-darwin (default)
    - node: 23.4.0
    - pnpm: 9.15.0
    - yarn: 1.22.22
    - npm: 10.9.2

[-] Packages
    - tauri 🦀: 2.1.1
    - tauri-build 🦀: 2.0.3
    - wry 🦀: 0.47.2
    - tao 🦀: 0.30.8
    - cargo-tauri 🦀: 1.0.3
    - @tauri-apps/api : 2.1.1
    - @tauri-apps/cli : 2.1.0

[-] Plugins
    - tauri-plugin-fs 🦀: 2.2.0
    - @tauri-apps/plugin-fs : not installed!
    - tauri-plugin-log 🦀: 2.2.0
    - @tauri-apps/plugin-log : 2.2.0
    - tauri-plugin-shell 🦀: 2.2.0
    - @tauri-apps/plugin-shell : 2.2.0
    - tauri-plugin-single-instance 🦀: 2.2.0
    - @tauri-apps/plugin-single-instance : not installed!
    - tauri-plugin-dialog 🦀: 2.2.0
    - @tauri-apps/plugin-dialog : 2.2.0

[-] App
    - build-type: bundle
    - CSP: unset
    - framework: Vue.js
    - bundler: Vite

Stack trace

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions