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

Tray icon on macos not working #3635

Open
katopz opened this issue Jan 23, 2025 · 0 comments
Open

Tray icon on macos not working #3635

katopz opened this issue Jan 23, 2025 · 0 comments

Comments

@katopz
Copy link

katopz commented Jan 23, 2025

Problem

Tray icon not appear

Steps To Reproduce

Steps to reproduce the behavior:

use dioxus::{
    desktop::trayicon::menu::{AboutMetadata, Menu, MenuItem, PredefinedMenuItem},
    prelude::*,
};

fn main() {
    dioxus::launch(App);

    let tray_menu = Menu::new();
    let quit_i = MenuItem::new("Quit", true, None);
    let _ = tray_menu.append_items(&[
        &PredefinedMenuItem::about(
            None,
            Some(AboutMetadata {
                name: Some("foo".to_string()),
                copyright: Some("Copyright bar".to_string()),
                ..Default::default()
            }),
        ),
        &PredefinedMenuItem::separator(),
        &quit_i,
    ]);

    let tray_icon = None;

    let tray_icon = dioxus::desktop::trayicon::init_tray_icon(tray_menu, tray_icon);
    tray_icon.set_title(Some("Hello, World!"));
}

#[component]
fn App() -> Element {
    rsx! { "HotDog!" }
}
  • dev
kill -9 $(lsof -ti:9090)
dx serve --platform desktop --port 9090 --features desktop
  • or build
dx bundle --platform desktop --  --features desktop

Expected behavior

Tray icon show while dev and run dmg after build

Actual behavior

Tray icon not show while dev and can't start dmg after build

Environment:

  • Dioxus version: 0.6.2
  • Rust version: 1.81.0
  • OS info: 15.2
  • App platform: desktop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant