Closed davide-baldo closed 1 year ago
I think this is because the Menu
is dropped and so the tray menu won't work which is the expected behavior, so please provide a minimal repro of what your code looks like so I can maybe take a look but you could try to save the Menu
in the tauri state store by calling app.manage(menu)
.
I will go ahead and close the issue but feel free to ping me when you have a repro.
Describe the bug
On linux when using
TrayIconBuilder
the menu is not shown upon click (left or right), giving this error:The menu appears if I leak the menu memory with
Box::leak(Box::new(..
Reproduction
This is reproducible on Linux using
api
example.examples/api/src-tauri
switch-menu
match, it has nothing to do with menu visibility, but somehow keeps things working by referencing the menus.Expected behavior
The menu should show up upon click of the tray icon.
Platform and versions
Stack trace
No response
Additional context
When leaking the menu memory it shows up, but it doesn't get refreshed when set again with
app_handle.tray().unwrap().set_menu()