зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1270954 - When Win10 Anniversary Update APIs are available, enable automatic scaling of the non-client area when a window is on a secondary display with different DPI. r=emk, a=kwierso
--HG-- extra : amend_source : 7eabc4033b2455549c74936c373aeea07a473cef
This commit is contained in:
Родитель
3d1c76ef59
Коммит
d723568aba
|
@ -487,6 +487,17 @@ WinUtils::Initialize()
|
|||
}
|
||||
}
|
||||
|
||||
// static
|
||||
LRESULT WINAPI
|
||||
WinUtils::NonClientDpiScalingDefWindowProcW(HWND hWnd, UINT msg,
|
||||
WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (msg == WM_NCCREATE && sEnableNonClientDpiScaling) {
|
||||
sEnableNonClientDpiScaling(hWnd);
|
||||
}
|
||||
return ::DefWindowProcW(hWnd, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
// static
|
||||
void
|
||||
WinUtils::LogW(const wchar_t *fmt, ...)
|
||||
|
|
|
@ -174,6 +174,12 @@ public:
|
|||
DPI_AWARENESS_CONTEXT mPrevContext;
|
||||
};
|
||||
|
||||
// Wrapper for DefWindowProc that will enable non-client dpi scaling on the
|
||||
// window during creation.
|
||||
static LRESULT WINAPI
|
||||
NonClientDpiScalingDefWindowProcW(HWND hWnd, UINT msg,
|
||||
WPARAM wParam, LPARAM lParam);
|
||||
|
||||
/**
|
||||
* Get the system's default logical-to-physical DPI scaling factor,
|
||||
* which is based on the primary display. Note however that unlike
|
||||
|
|
|
@ -799,7 +799,7 @@ nsWindow::RegisterWindowClass(const wchar_t* aClassName,
|
|||
}
|
||||
|
||||
wc.style = CS_DBLCLKS | aExtraStyle;
|
||||
wc.lpfnWndProc = ::DefWindowProcW;
|
||||
wc.lpfnWndProc = WinUtils::NonClientDpiScalingDefWindowProcW;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hInstance = nsToolkit::mDllInstance;
|
||||
|
|
Загрузка…
Ссылка в новой задаче