Bug 1837647 - limit GetDpiForMonitor to return default value to fix Win7 tests. r=dbaker,webrtc-reviewers

Upstream commit 60795e8c7a added a call to ::GetDpiForMonitor which is only
supported in Win8 and newer.  This is causing perma-orange on try, so we'll
disable it for now and fix properly in Bug 1837667.

Differential Revision: https://phabricator.services.mozilla.com/D180460
This commit is contained in:
Michael Froman 2023-06-09 19:59:12 +00:00
parent 2e186b9e3a
commit c6054a27c8

View File

@ -147,6 +147,11 @@ DesktopRect GetFullscreenRect() {
}
DesktopVector GetDpiForMonitor(HMONITOR monitor) {
// See Bug 1837647 - upstream commit 60795e8c7a added this method using
// ::GetDpiForMonitor which is not available on Win7 machines. For now,
// we'll return the default case of {96, 96} until we can properly
// restore the functionality for newer machines (See Bug 1837667).
#if 0
UINT dpi_x, dpi_y;
// MDT_EFFECTIVE_DPI includes the scale factor as well as the system DPI.
HRESULT hr = ::GetDpiForMonitor(monitor, MDT_EFFECTIVE_DPI, &dpi_x, &dpi_y);
@ -163,6 +168,7 @@ DesktopVector GetDpiForMonitor(HMONITOR monitor) {
ReleaseDC(nullptr, hdc);
return dpi;
}
#endif
// If everything fails, then return the default DPI for Windows.
return {96, 96};