rogerwang/node-webkit — pull request #2799 by mrfabbri (2014-12-14 23:42:16+00:00)
Title: Add tray click event position

Extend Tray click event with position …
- Add a parameter to the `click` event of the `Tray` API object containing the coordinates of the tray icon/mouse pointer.
The parameter has `x` and `y` fields for the coordinates.
On Mac OS X the coordinates always refer to the position (lower left corner) of the tray item (NSStatusItem).
On Aura (Linux, Windows) the coordinates refer to the cursor position (which would be inside the bounding box of the status icon but with slight differences depending on where effectively the user clicked).
- Add a manual test and an example usage (tray only application with a custom
tray menu) of the position parameter in `Tray` `click` event.

Usage example:

tray.on('click', function(pos) {
// pos.x is x coordinate of the tray icon
// pos.y is y coordinate of the tray icon
showCustomTrayMenuAt(pos);
}

Example (on Mac OS X):

![custom tray menu](https://cloud.githubusercontent.com/assets/3601/5429634/005be82c-83f3-11e4-8705-208169fe2d09.png)

[There is a small node-webkit icon in the manual test].

FIX rogerwang/node-webkit#1874