Index: ash/shell.cc |
diff --git a/ash/shell.cc b/ash/shell.cc |
index d84b700d6f308ce68b9d6dcc5d08b58092a1efc8..36cf332b9e9d24f42249da346ee6a0b263818336 100644 |
--- a/ash/shell.cc |
+++ b/ash/shell.cc |
@@ -321,7 +321,9 @@ aura::RootWindow* Shell::GetRootWindowAt(const gfx::Point& point) { |
for (RootWindowList::const_iterator iter = root_windows.begin(); |
iter != root_windows.end(); ++iter) { |
aura::RootWindow* root_window = *iter; |
- if (root_window->bounds().Contains(point)) |
+ const gfx::Display& display = |
+ gfx::Screen::GetDisplayNearestWindow(root_window); |
+ if (display.bounds().Contains(point)) |
return root_window; |
} |
// Fallback to the primary window if there is no root window containing |
@@ -341,7 +343,9 @@ aura::RootWindow* Shell::GetRootWindowMatching(const gfx::Rect& rect) { |
for (RootWindowList::const_iterator iter = root_windows.begin(); |
iter != root_windows.end(); ++iter) { |
aura::RootWindow* root_window = *iter; |
- gfx::Rect intersect = root_window->bounds().Intersect(rect); |
+ const gfx::Display& display = |
+ gfx::Screen::GetDisplayNearestWindow(root_window); |
+ gfx::Rect intersect = display.bounds().Intersect(rect); |
int area = intersect.width() * intersect.height(); |
if (area > max) { |
max = area; |