tauri-apps / tray-icon

Tray icons for Desktop Applications.
Apache License 2.0
183 stars 27 forks source link

Rewrite to use `objc2` #172

Closed madsmtm closed 1 week ago

madsmtm commented 1 week ago

This ensures that memory management rules are upheld, as well as greatly improving type-safety.

API-wise, this adds a new error case NotMainThread, which is triggered when a TrayIcon is created on a thread that is not the main thread.

There is probably a bug lurking in here somewhere, I'm not too familiar with the exact details of the NSStatusItem API. Notably, there's also still a lot of if Some(...) checks that I'm not sure are completely necessary, though this PR shouldn't make the situation any worse on that front.

Related: The migration to objc2 in wry: https://github.com/tauri-apps/wry/issues/1239

madsmtm commented 1 week ago

The "covector" CI step is failing, it seems to be lacking certain permissions?

amrbashir commented 1 week ago

yeah that workflow can be ignored, it doesn't like forks (we are working on it)

madsmtm commented 1 week ago

the migration on wry

I saw, it's nice! When you're ready, I'd be happy to help out, or review a PR, or something!

pewsheen commented 1 week ago

LGTM! We need a change file and need you to sign these commits.

madsmtm commented 1 week ago

We need a change file

Ah yeah, have done that now (not sure it's correct though).

(Would've been nice to note in the CONTRIBUTING.md btw, that'd make it pop up automatically when I submitted the PR).