mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +09:00
Merge remote-tracking branch 'origin/master' into custom
This commit is contained in:
commit
84282125cf
16 changed files with 98 additions and 16 deletions
|
|
@ -482,10 +482,20 @@ WinUtils::Initialize()
|
|||
if (IsWin10OrLater()) {
|
||||
HMODULE user32Dll = ::GetModuleHandleW(L"user32");
|
||||
if (user32Dll) {
|
||||
sEnableNonClientDpiScaling = (EnableNonClientDpiScalingProc)
|
||||
::GetProcAddress(user32Dll, "EnableNonClientDpiScaling");
|
||||
sSetThreadDpiAwarenessContext = (SetThreadDpiAwarenessContextProc)
|
||||
::GetProcAddress(user32Dll, "SetThreadDpiAwarenessContext");
|
||||
auto getThreadDpiAwarenessContext = (decltype(GetThreadDpiAwarenessContext)*)
|
||||
::GetProcAddress(user32Dll, "GetThreadDpiAwarenessContext");
|
||||
auto areDpiAwarenessContextsEqual = (decltype(AreDpiAwarenessContextsEqual)*)
|
||||
::GetProcAddress(user32Dll, "AreDpiAwarenessContextsEqual");
|
||||
if (getThreadDpiAwarenessContext && areDpiAwarenessContextsEqual &&
|
||||
areDpiAwarenessContextsEqual(getThreadDpiAwarenessContext(),
|
||||
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE)) {
|
||||
// Only per-monitor DPI awareness v1 requires these workarounds.
|
||||
// Since this was introduced in Win 8.1 we'll need to keep this indefinitely.
|
||||
sEnableNonClientDpiScaling = (EnableNonClientDpiScalingProc)
|
||||
::GetProcAddress(user32Dll, "EnableNonClientDpiScaling");
|
||||
sSetThreadDpiAwarenessContext = (SetThreadDpiAwarenessContextProc)
|
||||
::GetProcAddress(user32Dll, "SetThreadDpiAwarenessContext");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -501,7 +511,7 @@ LRESULT WINAPI
|
|||
WinUtils::NonClientDpiScalingDefWindowProcW(HWND hWnd, UINT msg,
|
||||
WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (msg == WM_NCCREATE && sEnableNonClientDpiScaling) {
|
||||
if (msg == WM_NCCREATE) {
|
||||
sEnableNonClientDpiScaling(hWnd);
|
||||
}
|
||||
return ::DefWindowProcW(hWnd, msg, wParam, lParam);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue