Closed twop closed 1 year ago
I was able to show the icon, it seems that it needs to be stored somewhere in a data structure so it won't be dropped? Will dig a little more and maybe send a PR to update the example
That would be appreciated, I am fine with just storing it in a Rc<RefCell<Option<TrayIcon>>>
@amrbashir I am getting the same with the "tao" example.
There are two changes that need to be made to that example:
tao::event_loop::EventLoop
is used instead of EventLoopBuilder
and in this library TrayEvent
instead of TrayIconEvent
The error:
Assertion failed: (CGAtomicGet(&is_initialized)), function CGSConnectionByID, file /System/Volumes/Data/SWE/macOS/BuildRoots/37599d3d49/Library/Caches/com.apple.xbs/Sources/SkyLight/SkyLight-588.10/SkyLight/Services/Connection/CGSConnection.mm, line 133.
[1] 19271 abort cargo run
I run this on a Mac Big Sur (not M1)
@oren0e the examples have been updated with this changes days ago. If you are facing a specific issue, feel free to open another issue with more details and steps to reproduce.
After looking what might have caused the error, it seems that the
NSApp
needs to be initialized first https://github.com/servo/core-foundation-rs/issues/176Indeed, moving tray creation inside the
run_native
function fixes the crashBUT there is no icon in sight! Note that other examples worked just fine (winit + tao)