Commit bcaa2d06 authored by Lucas Gadani's avatar Lucas Gadani Committed by Commit Bot

Return the primary display when the view doesn't have a window associated with it.

Bug: 769754
Change-Id: I909fed33dd12215b30c13b5d5c913337b56ef717
Reviewed-on: https://chromium-review.googlesource.com/690656Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505346}
parent f5e7996a
...@@ -415,6 +415,8 @@ const std::vector<Display>& ScreenWin::GetAllDisplays() const { ...@@ -415,6 +415,8 @@ const std::vector<Display>& ScreenWin::GetAllDisplays() const {
} }
Display ScreenWin::GetDisplayNearestWindow(gfx::NativeWindow window) const { Display ScreenWin::GetDisplayNearestWindow(gfx::NativeWindow window) const {
if (!window)
return GetPrimaryDisplay();
HWND window_hwnd = GetHWNDFromNativeView(window); HWND window_hwnd = GetHWNDFromNativeView(window);
if (!window_hwnd) { if (!window_hwnd) {
// When |window| isn't rooted to a display, we should just return the // When |window| isn't rooted to a display, we should just return the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment