Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Unified Diff: ui/display/win/screen_win.cc

Issue 2510793002: Use actual value of display scale factor from GetMonitorScaleFactor().
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/display/win/screen_win.h ('k') | ui/views/win/hwnd_message_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « ui/display/win/screen_win.h ('k') | ui/views/win/hwnd_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698