Implement 'right-clicked' tray event on Windows.
This commit is contained in:
parent
cca4f4abd5
commit
5ad3fff6a0
1 changed files with 10 additions and 9 deletions
|
@ -47,21 +47,22 @@ NotifyIcon::~NotifyIcon() {
|
||||||
|
|
||||||
void NotifyIcon::HandleClickEvent(const gfx::Point& cursor_pos,
|
void NotifyIcon::HandleClickEvent(const gfx::Point& cursor_pos,
|
||||||
bool left_mouse_click) {
|
bool left_mouse_click) {
|
||||||
|
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);
|
||||||
|
|
||||||
// Pass to the observer if appropriate.
|
// Pass to the observer if appropriate.
|
||||||
if (left_mouse_click) {
|
if (left_mouse_click) {
|
||||||
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));
|
NotifyClicked(gfx::Rect(rect));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NotifyRightClicked(gfx::Rect(rect));
|
||||||
|
|
||||||
if (!menu_model_)
|
if (!menu_model_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue