Index: ui/gfx/screen_win.cc |
diff --git a/ui/gfx/screen_win.cc b/ui/gfx/screen_win.cc |
index 9b33c6b20024f5154671e19c4e3202ef20917952..80614a4bf34a892a2a4fc506fa7a83cbafd26fff 100644 |
--- a/ui/gfx/screen_win.cc |
+++ b/ui/gfx/screen_win.cc |
@@ -57,6 +57,13 @@ int ScreenWin::GetNumDisplays() { |
gfx::Display ScreenWin::GetDisplayNearestWindow(gfx::NativeView window) const { |
HWND window_hwnd = GetHWNDFromNativeView(window); |
+ if (!window_hwnd) { |
Elliot Glaysher
2013/01/18 20:31:38
I'd like to fix this at a higher level, but there
|
+ // When |window| isn't rooted to a display, we should just return the |
+ // default display so we get some correct display information like the |
+ // scaling factor. |
+ return GetPrimaryDisplay(); |
+ } |
+ |
MONITORINFO monitor_info; |
monitor_info.cbSize = sizeof(monitor_info); |
GetMonitorInfo(MonitorFromWindow(window_hwnd, MONITOR_DEFAULTTONEAREST), |