Chromium Code Reviews| Index: ui/display/win/screen_win.cc |
| diff --git a/ui/display/win/screen_win.cc b/ui/display/win/screen_win.cc |
| index 86d6be41cd4e4a33e8a7dcc09600930582fa9e3e..1d92283a7e3e37ea6f3afc367c216244b855de26 100644 |
| --- a/ui/display/win/screen_win.cc |
| +++ b/ui/display/win/screen_win.cc |
| @@ -440,6 +440,12 @@ gfx::Rect ScreenWin::DIPToScreenRectInWindow(gfx::NativeView view, |
| return DIPToScreenRect(hwnd, dip_rect); |
| } |
| +float ScreenWin::GetScaleFactorForWindow(gfx::NativeView view) const { |
| + HWND hwnd = view ? GetHWNDFromNativeView(view) : nullptr; |
| + return GetMonitorScaleFactor( |
|
Andrey Kraynov
2016/11/16 18:33:47
Another possible and simple way to fix this issue
sadrul
2016/11/16 20:38:17
I think that would make sense, yeah. Is that possi
robliao
2016/11/16 20:56:17
WM_DPICHANGED is fired when an HWND is associated
|
| + ::MonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY)); |
| +} |
| + |
| void ScreenWin::UpdateFromDisplayInfos( |
| const std::vector<DisplayInfo>& display_infos) { |
| screen_win_displays_ = DisplayInfosToScreenWinDisplays(display_infos); |
| @@ -487,6 +493,7 @@ void ScreenWin::OnWndProc(HWND hwnd, |
| if (message != WM_DISPLAYCHANGE) |
| return; |
| + LOG(ERROR) << "ScreenWin::OnWndProc(WM_DISPLAYCHANGE)"; |
| std::vector<display::Display> old_displays = GetAllDisplays(); |
| UpdateFromDisplayInfos(GetDisplayInfosFromSystem()); |
| change_notifier_.NotifyDisplaysChanged(old_displays, GetAllDisplays()); |