tauri-apps / tauri-apps/plugins-workspace

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

Open
#2,236 3 comments 0 reactions 0 assignees View on GitHub
platform: macos plugin: dialog type: bug
Dominant language
Rust
Stars
1.8k
Forks
602
Avg merge
4d 14h
Merged PRs (30d)
9

Description

### 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](https://github.com/user-attachments/assets/016a9aa4-b06e-4a8f-8f84-98b7d86d3b56)

### Reproduction

```rust
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

```text
[✔] 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.