Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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 opened this issue Dec 23, 2024 · 3 comments
Labels
bug Something isn't working platform: macos macOS specific issues plugin: dialog

Comments

@persiliao
Copy link

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

@persiliao persiliao changed the title [bug] dialog is called in tauri::async_runtime, and the pop-up window does not have the screen centered [bug] @tauri-apps/plugin-dialog dialog is called in tauri::async_runtime, and the pop-up window does not have the screen centered Dec 23, 2024
@FabianLars
Copy link
Member

Where exactly are you calling that? In the setup hook?

@FabianLars FabianLars transferred this issue from tauri-apps/tauri Dec 24, 2024
@FabianLars FabianLars added bug Something isn't working plugin: dialog platform: macos macOS specific issues labels Dec 24, 2024
@FabianLars
Copy link
Member

Also, this sounds related to a known issue where the dialog opens at the tray icon when there's no open window, but that should be unrelated to the use of async_runtime. I can't find the github issue for that right now though it's mentioned here #1306 as well

@persiliao
Copy link
Author

@FabianLars That's right, I called dialog in the event in the tray menu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform: macos macOS specific issues plugin: dialog
Projects
None yet
Development

No branches or pull requests

2 participants