AlertWindows not scaled in HiDPI mode

Hi!

It seems that AlertWindows are not correctly scaled in DAWs that have a dedicated HiDPI mode.
I am using a Windows scaling of 200% with HiDpi mode switched on in Cubase, Reaper or StudioOne. The plugin editor is scaled correctly, but any AlertWindow that is opened from the plugin remains extremely small and can not be scaled.
Same situation on macOS.

As far as I could see, this happens since a commit from March, 2nd 2020 (between JUCE 5.4.7 and JUCE 6.0):

  • Windows: Refactored DPI handling in the VST wrapper and hosting code

Since then, the plugin windows in HiDpi mode are scaled using an AffineTransform. But as AffineTransform does not work for Components on the Desktop, the AlertWindows remain unscaled.

Does anybody know a fix or a workaround to get AlertWindows to the correct size in HiDPI mode?

Which version of JUCE are you using for testing? Some changes in this area were made in the last couple of weeks, so I’d recommend trying out the latest develop commit if you haven’t already.

I’ve just checked the latest version from the develop branch with a simple test plugin that just has a button which opens an AlertWindow using AlertWindow::showMessageBox(). Unfortunately this made no difference.

Thanks for reporting this, this was a separate bug in JUCE. I’ve attempted to resolve the issue here:

To scale an AlertWindow appropriately for a plugin, you should set the associatedComponent argument of the launch function to your plugin editor, or a child of your editor.

Please let me know if you run into any issues with this change.

1 Like

This seems to work well.
Thanks for the quick fix!

Having the same problem. In dpi aware hosts on windows the UI scales correctly but the alert windows show up as really tiny. I am on Juce version 6.1.2.
I am using AlertWindow::showOkCancelBox and provide this->getTopLevelComponent () as associated component.

How can I fix this?

Solved it. The problem was getTopLevelComponent.
Using findParentComponentOfClassjuce::AudioProcessorEditor() instead and the alert windows are scaled correctly!

Still happens me on the latest master. I’m not passing any parameter to the associate component.

It seems all the dialogWindow is in 1x while my main window is in 2x.