From adec7185039c97849470a5efd0abb6b066028016 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 13 Jul 2014 22:15:03 +0800 Subject: [PATCH] win: Fix showing menu on High DPI display. --- atom/browser/api/atom_api_menu_views.cc | 7 +++++++ vendor/brightray | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/atom/browser/api/atom_api_menu_views.cc b/atom/browser/api/atom_api_menu_views.cc index 723b6259..3a97ad81 100644 --- a/atom/browser/api/atom_api_menu_views.cc +++ b/atom/browser/api/atom_api_menu_views.cc @@ -8,6 +8,10 @@ #include "ui/gfx/screen.h" #include "ui/views/controls/menu/menu_runner.h" +#if defined(OS_WIN) +#include "ui/gfx/win/dpi.h" +#endif + namespace atom { namespace api { @@ -17,6 +21,9 @@ MenuViews::MenuViews() { void MenuViews::Popup(Window* window) { gfx::Point cursor = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint(); +#if defined(OS_WIN) + cursor = gfx::win::ScreenToDIPPoint(cursor); +#endif menu_runner_.reset(new views::MenuRunner(model())); views::MenuRunner::RunResult result = menu_runner_->RunMenuAt( diff --git a/vendor/brightray b/vendor/brightray index 05ae6865..227af5c6 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 05ae6865c8147b0924d74533bcabb68ec26a284a +Subproject commit 227af5c6af2ce54df0916bc61168045c177d3d39 -- 2.43.0