Add support for click event in Windows #59
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for hooking into the left-click event on the systray icon in Windows. It adds a global ClickedCh channel, similar to the menu item channel. If there are no receivers it will open the menu as it currently does. If there is a receiver, then the event is passed through the channel.
I looked into adding similar functionality for Linux. I could hook into the click event (by listening to about-to-show signal on the menu). However i could not find a way to prevent the menu from loading, so the behavior would be different. Not sure if the support would be useful, but i can submit as well if it would be.
Haven't looked at Mac support yet, but may be able to later this week. I'm not sure that overriding left-click behavior would be desirable on Mac/Linux, however in the case of Windows it's not common to show a menu on left-click so i think this PR may be reasonable.