win: Fix showing menu on High DPI display.
authorCheng Zhao <zcbenz@gmail.com>
Sun, 13 Jul 2014 14:15:03 +0000 (22:15 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Sun, 13 Jul 2014 14:22:56 +0000 (22:22 +0800)
atom/browser/api/atom_api_menu_views.cc
vendor/brightray

index 723b625..3a97ad8 100644 (file)
@@ -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(
index 05ae686..227af5c 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 05ae6865c8147b0924d74533bcabb68ec26a284a
+Subproject commit 227af5c6af2ce54df0916bc61168045c177d3d39