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

* add Tray.mouse-move on win

* change docs
This commit is contained in:
Micha Hanselmann 2019-07-18 10:52:15 -07:00 committed by Shelley Vohr
parent 9711fc895e
commit 2467350180
4 changed files with 15 additions and 1 deletions

View file

@ -65,6 +65,13 @@ void NotifyIcon::HandleClickEvent(int modifiers,
}
}
void NotifyIcon::HandleMouseMoveEvent(int modifiers) {
gfx::Point cursorPos = display::Screen::GetScreen()->GetCursorScreenPoint();
// Omit event fired when tray icon is created but cursor is outside of it.
if (GetBounds().Contains(cursorPos))
NotifyMouseMoved(cursorPos, modifiers);
}
void NotifyIcon::ResetIcon() {
NOTIFYICONDATA icon_data;
InitIconData(&icon_data);