Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support `mouse-move` event of Tray API on Windows #19265

Merged
merged 2 commits into from Jul 18, 2019

Conversation

@deermichel
Copy link

deermichel commented Jul 15, 2019

Description of Change

Adds support for the mouse-move event of Tray API on Windows. Due to Win32-API limitations* it currently isn't possible to port mouse-enter/leave as well. Their behavior can be emulated by using mouse-move and a timer.

*In order to detect when the mouse leaves the icon, we need to listen for WM_MOUSELEAVE messages. This message will only be fired after creating a tracking request using TrackMouseEvent. Apparently, NotifyIcon (Win32 API used to display the tray icon) doesn't work with this method. If I missed sth, feel free to add the other events in a new PR.

cc @nornagon @erickzhao

Checklist

Release Notes

Notes: Added support for mouse-move event of Tray API on Windows.

Micha Hanselmann added 2 commits Jul 15, 2019
Micha Hanselmann
Micha Hanselmann
@deermichel deermichel requested a review from erickzhao Jul 15, 2019
Copy link
Member

erickzhao left a comment

code LGTM

@miniak

This comment has been minimized.

Copy link
Contributor

miniak commented Jul 16, 2019

@deermichel It should be possible to support enter / leave by opting into the latest version of the tray icon API using NIM_SETVERSION

In addition to those messages, as of Windows Vista (Shell32.dll version 6.0.6), if a user passes the mouse pointer over an icon with which a balloon notification is associated, the Windows Vista Shell also adds the following messages:
NIN_POPUPOPEN. Sent when the user hovers the cursor over an icon to indicate that the richer pop-up UI should be used in place of a standard textual tooltip.
NIN_POPUPCLOSE. Sent when a cursor no longer hovers over an icon to indicate that the rich pop-up UI should be closed.

@electron-cation electron-cation bot removed the new-pr 🌱 label Jul 16, 2019
@codebytere codebytere merged commit 2467350 into master Jul 18, 2019
11 checks passed
11 checks passed
Artifact Comparison No Changes
Details
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
appveyor: win-ia32-testing AppVeyor build succeeded
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
build-linux Workflow: build-linux
Details
build-mac Workflow: build-mac
Details
lint Workflow: lint
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

release-clerk bot commented Jul 18, 2019

Release Notes Persisted

Added support for mouse-move event of Tray API on Windows.

@codebytere codebytere deleted the intern/win-tray-mousemove branch Jul 18, 2019
@orangeChu

This comment has been minimized.

Copy link

orangeChu commented Aug 9, 2019

I wonder if version 4.x will add this feature. Thank you for all you have done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.