From 5c8566e0d4fedc22c9fa6e6bf7e9ca340fe30e5e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 2 Oct 2013 21:43:52 +0800 Subject: [PATCH] win: Show popup menu at right place. --- browser/api/atom_api_menu_win.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/browser/api/atom_api_menu_win.cc b/browser/api/atom_api_menu_win.cc index 019d011..3e41ab1 100644 --- a/browser/api/atom_api_menu_win.cc +++ b/browser/api/atom_api_menu_win.cc @@ -8,6 +8,7 @@ #include "browser/ui/win/menu_2.h" #include "common/v8_conversions.h" #include "ui/gfx/point.h" +#include "ui/gfx/screen.h" namespace atom { @@ -21,8 +22,9 @@ MenuWin::~MenuWin() { } void MenuWin::Popup(NativeWindow* native_window) { + gfx::Point cursor = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint(); menu_.reset(new atom::Menu2(model_.get())); - menu_->RunContextMenuAt(gfx::Point(0, 0)); + menu_->RunContextMenuAt(cursor); } // static -- 2.7.4