1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Windowing: Ignore suggested window sizes for windows that should not be DPI aware

This commit is contained in:
reuk 2021-09-16 11:21:12 +01:00
parent ea6d095ab5
commit 8b45ff83e2
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -3370,6 +3370,12 @@ private:
LRESULT handleDPIChanging (int newDPI, RECT newRect)
{
// Sometimes, windows that should not be automatically scaled (secondary windows in plugins)
// are sent WM_DPICHANGED. The size suggested by the OS is incorrect for our unscaled
// window, so we should ignore it.
if (! isPerMonitorDPIAwareWindow (hwnd))
return 0;
const auto newScale = (double) newDPI / USER_DEFAULT_SCREEN_DPI;
if (approximatelyEqual (scaleFactor, newScale))