From ecef83f8f570fd051175358cd85d3d0ca5813adf Mon Sep 17 00:00:00 2001 From: Heilig Benedek Date: Thu, 28 Jul 2016 02:07:37 +0200 Subject: [PATCH] added khronos and fix for offscreen --- brightray/brightray.gyp | 1 + brightray/browser/inspectable_web_contents_impl.cc | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index 4de2f5259a..4bbfbdf991 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -29,6 +29,7 @@ '<(libchromiumcontent_src_dir)/third_party/skia/include/config', '<(libchromiumcontent_src_dir)/third_party/icu/source/common', '<(libchromiumcontent_src_dir)/third_party/mojo/src', + '<(libchromiumcontent_src_dir)/third_party/khronos', '<(libchromiumcontent_src_dir)/third_party/WebKit', '<(libchromiumcontent_dir)/gen', ], diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 210a69392e..a83a9d8b2a 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -221,8 +221,14 @@ InspectableWebContentsImpl::InspectableWebContentsImpl( devtools_bounds_.set_width(800); } if (!IsPointInScreen(devtools_bounds_.origin())) { - gfx::Rect display = display::Screen::GetScreen()-> + gfx::Rect display; + if (web_contents->GetNativeView()) { + display = display::Screen::GetScreen()-> GetDisplayNearestWindow(web_contents->GetNativeView()).bounds(); + } else { + display = display::Screen::GetScreen()->GetPrimaryDisplay().bounds(); + } + devtools_bounds_.set_x(display.x() + (display.width() - devtools_bounds_.width()) / 2); devtools_bounds_.set_y(display.y() + (display.height() - devtools_bounds_.height()) / 2); }