mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
Windowing: Avoid dynamically loading EnableNonClientDpiScaling, which is always present on Windows 10
This commit is contained in:
parent
e2a1af48e5
commit
5048d359e5
1 changed files with 2 additions and 10 deletions
|
|
@ -335,9 +335,6 @@ static void checkForPointerAPI()
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
using GetSystemMetricsForDpiFunc = int (WINAPI*) (int, UINT);
|
using GetSystemMetricsForDpiFunc = int (WINAPI*) (int, UINT);
|
||||||
using EnableNonClientDPIScalingFunc = BOOL (WINAPI*) (HWND);
|
|
||||||
|
|
||||||
static EnableNonClientDPIScalingFunc enableNonClientDPIScaling = nullptr;
|
|
||||||
|
|
||||||
static bool hasCheckedForDPIAwareness = false;
|
static bool hasCheckedForDPIAwareness = false;
|
||||||
|
|
||||||
|
|
@ -349,10 +346,6 @@ static void loadDPIAwarenessFunctions()
|
||||||
|
|
||||||
if (shcoreModule == nullptr)
|
if (shcoreModule == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if JUCE_WIN_PER_MONITOR_DPI_AWARE
|
|
||||||
enableNonClientDPIScaling = (EnableNonClientDPIScalingFunc) getUser32Function ("EnableNonClientDpiScaling");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setDPIAwareness()
|
static void setDPIAwareness()
|
||||||
|
|
@ -370,8 +363,7 @@ static void setDPIAwareness()
|
||||||
if (SetProcessDpiAwarenessContext (DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2))
|
if (SetProcessDpiAwarenessContext (DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (enableNonClientDPIScaling != nullptr
|
if (SUCCEEDED (SetProcessDpiAwareness (PROCESS_PER_MONITOR_DPI_AWARE)))
|
||||||
&& SUCCEEDED (SetProcessDpiAwareness (PROCESS_PER_MONITOR_DPI_AWARE)))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (SUCCEEDED (SetProcessDpiAwareness (PROCESS_SYSTEM_DPI_AWARE)))
|
if (SUCCEEDED (SetProcessDpiAwareness (PROCESS_SYSTEM_DPI_AWARE)))
|
||||||
|
|
@ -3619,7 +3611,7 @@ private:
|
||||||
// Ensure that non-client areas are scaled for per-monitor DPI awareness v1 - can't
|
// Ensure that non-client areas are scaled for per-monitor DPI awareness v1 - can't
|
||||||
// do this in peerWindowProc as we have no window at this point
|
// do this in peerWindowProc as we have no window at this point
|
||||||
if (message == WM_NCCREATE)
|
if (message == WM_NCCREATE)
|
||||||
NullCheckedInvocation::invoke (enableNonClientDPIScaling, h);
|
EnableNonClientDpiScaling (h);
|
||||||
|
|
||||||
if (auto* peer = getOwnerOfWindow (h))
|
if (auto* peer = getOwnerOfWindow (h))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue