Merge pull request #1848 from Bitbored/master

Added `bounds` payload to tray `clicked` event on Windows
This commit is contained in:
Cheng Zhao 2015-06-09 10:49:01 +08:00
commit 03ab9b2686
2 changed files with 11 additions and 2 deletions

View file

@ -49,7 +49,16 @@ void NotifyIcon::HandleClickEvent(const gfx::Point& cursor_pos,
bool left_mouse_click) {
// Pass to the observer if appropriate.
if (left_mouse_click) {
NotifyClicked();
NOTIFYICONIDENTIFIER icon_id;
memset(&icon_id, 0, sizeof(NOTIFYICONIDENTIFIER));
icon_id.uID = icon_id_;
icon_id.hWnd = window_;
icon_id.cbSize = sizeof(NOTIFYICONIDENTIFIER);
RECT rect = { 0 };
Shell_NotifyIconGetRect(&icon_id, &rect);
NotifyClicked(gfx::Rect(rect));
return;
}

View file

@ -55,7 +55,7 @@ Creates a new tray icon associated with the `image`.
Emitted when the tray icon is clicked.
__Note:__ The `bounds` payload is only implemented on OS X.
__Note:__ The `bounds` payload is only implemented on OS X and Windows 7 or newer.
### Event: 'double-clicked'