Windows plug-in scaling

gui
#1

Hi everybody,

I’m having a problem rescaling my plug-in only on Windows and in some DAWs like Pro Tools. I’m puzzled on what’s going on so I’ll make some statements first:

  • Everything works fine in Mac. This issue is only present in Windows.
  • Everything works fine in Reaper, which is my main DAW for debugging.
  • I’m able to replicate the issue in Juce PluginHost.
  • I’m testing everything on a Microsoft Surface Laptop.
  • I have the latest JUCE version on develop (pulled a few days ago).
  • Using Visual Studio 2017 and Windows 10.
  • Everything works fine if the default Windows scaling is set to 100%, problems come if the default resolution is set to anything but 100%. I have it on 150%, which is the recommended setting.
  • Everything works fine when opening the UI.

By reference, this is how the plug-in should look:

In resized() I’m positioning all elements like this:
myComponent->setBounds(roundToInt(45.f * scale), roundToInt(87.f * scale), roundToInt(100.f * scale), roundToInt(100.f * scale));

The “scale” is a float that I change its value from 0.5f to 2.f (50% to 200% size), selectable by the user like this:
scale = 1.25f;
setSize(roundToInt(650.f * scale), roundToInt(560.f * scale));

I launch PluginHost and load the plug-in. If I change the plug-in size and the Windows scaling is set to something else than 100% the UI is cropped. It looks like this:

Closing and opening the window again makes it look perfect. Changing the size again makes it look cropped.
Enabling DPI awareness inside PluginHost works.
Captura4

These are my settings in Windows scaling (in spanish):

I have tested this with another plug-in that I know it’s made with JUCE and the same issue can be replicated.
However, “Sugar”, the plug-in from process.Audio developed by Ivan Cohen, works fine in all cases. I have been talking with Ivan about this and we haven’t come to an understanding of what I’m doing wrong, or what he is doing right :slight_smile:

I’m puzzled about this, any help appreciated!

Edit: Ivan tells me that he is using an older version of JUCE for the Sugar plug-in. JUCE 5.3.2.

Edit 2: This is a video of Reels by Audiothing. It has a Resiable Corner and I think it can better explain what’s going on. It looks like there’s a SetSize missing somewhere. https://streamable.com/6l55i

1 Like

DPI scaling not taking place in plugins on Windows
#2

Are you saying that it scales correctly when the “Enable DPI awareness” setting is enabled in the JUCE plug-in host? Does it scale incorrectly in any other DAWs? What format is the plug-in - VST2 or VST3?

0 Likes

#3

Are you saying that it scales correctly when the “Enable DPI awareness” setting is enabled in the JUCE plug-in host?

Yes, when “Enable DPI awareness” is enabled the scaling is correct.

Does it scale incorrectly in any other DAWs?

At the moment I have only received complaints from Pro Tools users. I have tried in Reaper and Ableton Live and it works on those.

What format is the plug-in - VST2 or VST3?

In PluginHost I’m loading VST3. In Pro Tools AAX.

0 Likes

#4

Are you able to reproduce the issue with the AudioPluginDemo? I’m not seeing any scaling issues running the AAX build in ProTools on Windows 10 with a scaled display.

Perhaps try disabling per-monitor DPI awareness by setting the JUCE_WIN_PER_MONITOR_DPI_AWARE flag to 0 in juce_gui_basics.

0 Likes

#5

AudioPluginDemo works fine in PluginHost.

I have tried disabling JUCE_WIN_PER_MONITOR_DPI but it makes no difference.

I’m sorry I can’t bring you more information, would you like to try directly with my plug-in? I can send you a download link in a private message.

0 Likes

#6

The problem there looks related to this one to me: Errors with DPI scaling in Windows 7

0 Likes