mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 09:54:42 +00:00
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:
parent
2e186b9e3a
commit
c6054a27c8
@ -147,6 +147,11 @@ DesktopRect GetFullscreenRect() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DesktopVector GetDpiForMonitor(HMONITOR monitor) {
|
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;
|
UINT dpi_x, dpi_y;
|
||||||
// MDT_EFFECTIVE_DPI includes the scale factor as well as the system DPI.
|
// MDT_EFFECTIVE_DPI includes the scale factor as well as the system DPI.
|
||||||
HRESULT hr = ::GetDpiForMonitor(monitor, MDT_EFFECTIVE_DPI, &dpi_x, &dpi_y);
|
HRESULT hr = ::GetDpiForMonitor(monitor, MDT_EFFECTIVE_DPI, &dpi_x, &dpi_y);
|
||||||
@ -163,6 +168,7 @@ DesktopVector GetDpiForMonitor(HMONITOR monitor) {
|
|||||||
ReleaseDC(nullptr, hdc);
|
ReleaseDC(nullptr, hdc);
|
||||||
return dpi;
|
return dpi;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// If everything fails, then return the default DPI for Windows.
|
// If everything fails, then return the default DPI for Windows.
|
||||||
return {96, 96};
|
return {96, 96};
|
||||||
|
Loading…
Reference in New Issue
Block a user