DioxusLabs / DioxusLabs/dioxus

Tray icon on macos not working

Open
#3,635 2 comments 2 reactions 0 assignees View on GitHub
breaking bug desktop
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

**Problem**

Tray icon not appear

**Steps To Reproduce**

Steps to reproduce the behavior:

- add tray icon e.g.
https://github.com/catboard-finance/catboard-app/blob/383248dac35b319f4b3b746e77ccc307f9d6b7fb/src/main.rs
```rust
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
```bash
kill -9 $(lsof -ti:9090)
dx serve --platform desktop --port 9090 --features desktop
```
- or build
```bash
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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.