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] tray disappears in macOS #12060

Open
codelover2k opened this issue Dec 26, 2024 · 0 comments
Open

[bug] tray disappears in macOS #12060

codelover2k opened this issue Dec 26, 2024 · 0 comments
Labels
platform: macOS status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@codelover2k
Copy link

Describe the bug

The tray in macOS behaves inconsistently. It appears and disappears unpredictably under these circumstances:

  • When I run or build the app, the tray sometimes disappears.
  • Changing the title in the setup causes the tray to vanish, but also not always.
  • Restarting macOS temporarily resolves the issue, but after a few app restarts or recompiles, the tray disappears again.

Additional observations:

  • Occasionally, the tray reappears if I wait while the app is still running.
  • No errors or panics are logged during these events.

Reproduction

#[tauri::command]
fn change_tray_title(app_handle: AppHandle, title: String) {
    println!("title from frontend: {}", title);

    let tray_handle = app_handle.tray_by_id("tray").unwrap();

    if let Err(e) = tray_handle.set_title(Some(&title)) {
        eprintln!("failed to set title: {}", e);
    } else {
        println!("title set successfully to '{}'", title);
    }
}

Expected behavior

tray should not vanish on title or icon changes

Full tauri info output

[✔] Environment
    - OS: Mac OS 15.0.1 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
    ✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 20.12.0
    - pnpm: 8.7.5
    - npm: 10.5.0
    - bun: 1.0.2

[-] Packages
    - tauri 🦀: 2.1.1
    - tauri-build 🦀: 2.0.3
    - wry 🦀: 0.47.0
    - tao 🦀: 0.30.6
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli : 2.1.0

[-] Plugins
    - tauri-plugin-shell 🦀: 2.2.0
    - @tauri-apps/plugin-shell : not installed!

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React
    - bundler: Vite

Stack trace

no errors

Additional context

No response

@codelover2k codelover2k added status: needs triage This issue needs to triage, applied to new issues type: bug labels Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: macOS status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants