High-DPI support how to


#1

JUCE 5.1 Release notes state the following

Scaling support for plugins
Added support for VST 2 and 3 extensions that allow a host to give a plugin the scale-factor that it should use for its UI. This will solve the problem of Windows high-DPI support for plugins in hosts which support this.

How should the host tell the plugin to use a certain scale factor? Is that the
AudioProcessorEditor::setScaleFactor() function?

If so - it does not seem to work on Windows as soon as the scale in windows is set to anything other than 100% the result of a plugin window is not scaled properly.

The audio plugin host example does not really offer any insight as its PluginWindow class overrides the getDesktopScaleFactor function and ALWAYS returns 1.0f scale resulting in obviously tiny windows when scale is set to above 100%.

Is there a way to take advantage of this functionality and properly handle the High-DPI mess?
Talking from the plugin host perspective, not plugin developer.

I see that some hosts do seem to properly scale the plugin’s UI (Cubase on windows for example), but it seems that all they do is resample the window so it’s blury.

VST’s “CFrame” class has a method called “setZoom()” - is that something that could be utilized?

Any advice is appreciated - thanks.