fyne-io / systray

a cross platfrom Go library to place an icon and menu in the notification area
Apache License 2.0
227 stars 42 forks source link

Simplify menu locks and use systrayMenuItemSelected into Event and EventGroup #18

Closed slytomcat closed 2 years ago

slytomcat commented 2 years ago

I've returned systrayMenuItemSelected() into systray.go and make it used into Event() and EventGroup(). It's seems more elegant solution.

Usage of the instance locks is also simplified (it's much easier to support the code when locks are used in more simpler way).

andydotxyz commented 2 years ago

Can you check this is based on latest master? That returned method was already re-added because removing it broke macOS and Windows (oops!). I placed it in a "non-linux" file so we didn't get the unused code warning again.

slytomcat commented 2 years ago

I noticed that removed systrayMenuItemSelected() broke macOS and Windows builds. That's why I've created this MR. But I missed that you already fixed it.

I think that it's better to re-add this method and start use it for Linux version also as Event() and EventGroup() actually had the same functionality in their code (2 copy of the same code as systrayMenuItemSelected already has).

I'll try to rebase this commit on latest master.

slytomcat commented 2 years ago

Rebased to latest master.

slytomcat commented 2 years ago

Some fixes