win: Fix showing menu on High DPI display.
This commit is contained in:
parent
7c8a0ae2a3
commit
adec718503
2 changed files with 8 additions and 1 deletions
|
@ -8,6 +8,10 @@
|
||||||
#include "ui/gfx/screen.h"
|
#include "ui/gfx/screen.h"
|
||||||
#include "ui/views/controls/menu/menu_runner.h"
|
#include "ui/views/controls/menu/menu_runner.h"
|
||||||
|
|
||||||
|
#if defined(OS_WIN)
|
||||||
|
#include "ui/gfx/win/dpi.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
namespace api {
|
namespace api {
|
||||||
|
@ -17,6 +21,9 @@ MenuViews::MenuViews() {
|
||||||
|
|
||||||
void MenuViews::Popup(Window* window) {
|
void MenuViews::Popup(Window* window) {
|
||||||
gfx::Point cursor = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint();
|
gfx::Point cursor = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint();
|
||||||
|
#if defined(OS_WIN)
|
||||||
|
cursor = gfx::win::ScreenToDIPPoint(cursor);
|
||||||
|
#endif
|
||||||
|
|
||||||
menu_runner_.reset(new views::MenuRunner(model()));
|
menu_runner_.reset(new views::MenuRunner(model()));
|
||||||
views::MenuRunner::RunResult result = menu_runner_->RunMenuAt(
|
views::MenuRunner::RunResult result = menu_runner_->RunMenuAt(
|
||||||
|
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 05ae6865c8147b0924d74533bcabb68ec26a284a
|
Subproject commit 227af5c6af2ce54df0916bc61168045c177d3d39
|
Loading…
Add table
Add a link
Reference in a new issue