From 472a95e433333b2303228b89543815efa9f4b3b7 Mon Sep 17 00:00:00 2001 From: Yeechan Lu Date: Sun, 27 Jul 2014 15:50:04 +0800 Subject: [PATCH] win: Fix tray context menu in high DPI mode --- atom/browser/ui/win/notify_icon.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/atom/browser/ui/win/notify_icon.cc b/atom/browser/ui/win/notify_icon.cc index c94ce3183b33..348ee9310364 100644 --- a/atom/browser/ui/win/notify_icon.cc +++ b/atom/browser/ui/win/notify_icon.cc @@ -12,6 +12,7 @@ #include "ui/gfx/icon_util.h" #include "ui/gfx/point.h" #include "ui/gfx/rect.h" +#include "ui/gfx/win/dpi.h" #include "ui/views/controls/menu/menu_runner.h" namespace atom { @@ -64,7 +65,7 @@ void NotifyIcon::HandleClickEvent(const gfx::Point& cursor_pos, views::MenuRunner::RunResult result = menu_runner_->RunMenuAt( NULL, NULL, - gfx::Rect(cursor_pos, gfx::Size()), + gfx::Rect(gfx::win::ScreenToDIPPoint(cursor_pos), gfx::Size()), views::MenuItemView::TOPLEFT, ui::MENU_SOURCE_MOUSE, views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU);