Displays::Display::scale always 1.0 from within windows DAWs

Hi,
I’m hitting an issue when trying to ensure a user doesn’t make their plugin bigger than their monitor.

I’m using Windows 10 (I’ve not tried mac) and Juce 6.0.1

The following works as expected when using the plugin as a standalone, but not when hosted in a DAW (I’ve tried Reaper and FL Studio)

I have two monitors, which for testing purposes I’ve set to 125% scaling and 200% scaling.
However scale is always set to 1.0 in Displays::Display::scale

I’m obtaining a Displays::Display via Displays::findDisplayForPoint and this is also true internally when calling to Displays:: logicalToPhysical()

Have I encountered an issue, am I using this incorrectly or is this just not expected to work from within DAWs?

Thanks for any assistance you can provide!
Dave

This is intentional on Windows as we rely on using an AffineTransform to scale the top-level editor Component instead of the Desktop scale that is used in standalone apps. You can use Component::getApproximateScaleFactorForComponent() on your editor to get the scale factor that has been set by the DAW.

1 Like