win: Fix tray context menu in high DPI mode

This commit is contained in:
Yeechan Lu 2014-07-27 15:50:04 +08:00
parent b84226244d
commit 472a95e433

View file

@ -12,6 +12,7 @@
#include "ui/gfx/icon_util.h" #include "ui/gfx/icon_util.h"
#include "ui/gfx/point.h" #include "ui/gfx/point.h"
#include "ui/gfx/rect.h" #include "ui/gfx/rect.h"
#include "ui/gfx/win/dpi.h"
#include "ui/views/controls/menu/menu_runner.h" #include "ui/views/controls/menu/menu_runner.h"
namespace atom { namespace atom {
@ -64,7 +65,7 @@ void NotifyIcon::HandleClickEvent(const gfx::Point& cursor_pos,
views::MenuRunner::RunResult result = menu_runner_->RunMenuAt( views::MenuRunner::RunResult result = menu_runner_->RunMenuAt(
NULL, NULL,
NULL, NULL,
gfx::Rect(cursor_pos, gfx::Size()), gfx::Rect(gfx::win::ScreenToDIPPoint(cursor_pos), gfx::Size()),
views::MenuItemView::TOPLEFT, views::MenuItemView::TOPLEFT,
ui::MENU_SOURCE_MOUSE, ui::MENU_SOURCE_MOUSE,
views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU); views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU);