Juce 8 (and 7) bug - resizable PluginEditor growing on Windows

Hey folks,

here is another one, again Window 11.

When creating a plugin from scratch and making the PluginEditor resizable using a constrainer to set the size limits, the plugin window grows when moving from a screen with lower scale to a screen with higher scale while having the window at the minimum size initially.

Tested in VST3 (Reaper and Cubase 13).

@reuk Any idea how to fix that? It seems to be a bug in juce.

Please confirm that the issue is present in the latest version of JUCE.

Can you provide any code to reproduce the issue? Alternatively, is the issue present in any of the JUCE example plugins? The AudioPluginDemo includes a constrainer with a minimum and maximum size.

@reuk Yes, latest Juce tip and Juce 7 as well.

I haven’t tested the juce examples but it is straight forward. Just create a new plugin using Projucer, create a constrainer with min and max size and let it be the constrainer of the PluginEditor. Set the PluginEditor to resizable and you can observer the effect. Windows only.

If you can confirm that the issue is present in the JUCE examples, that would be a strong indication that the issue is in JUCE itself. If the examples are unaffected, then that might indicate that the issue is caused by some aspect your particular plugin.

@reuk Can you please point me to the right example? I tried various but none have a constrainer.

This demo is in examples/Plugins.

@reuk Yeah, i tried gain and surroundplugin, both resize, but do not have a constrainer.

Please try the AudioPluginDemo example.

@reuk Ah, ok, i see it. Yes, bug confirmed there as well.

Move to a screen with 100%, minimize size, then move to a screen with 150%. Size increases visibly.

Please provide as much information as possible. Ideally, include some screenshots so that I can better understand the exactly behaviour you’re seeing.

  • Which Windows version are you testing?
  • Which REAPER version are you testing?
  • Have you tested on other computers or with other Windows versions, and do you see the same behaviour in all cases?

What is “size increases visibly” referring to here? Physical or logical size? When switching between displays, we’d expect that the physical size should change in order to preserve the logical size.

Here’s what I see with REAPER 7.30 on Windows 11. The AudioPluginDemo looks like this on a 100% scaled screen. Measuring the width, we can see that it is 400 physical pixels wide.

Then, if I drag the editor to a screen with 150% scaling, this is what I get. The editor is 600 physical pixels wide, which is 600 / 1.5 = 400 logical pixels. The logical size is consistent, which is the expected behaviour.

Does this differ from the behaviour you see? If so, please provide as much information as possible about your environment so that we can reproduce the issue.

@reuk Ok, here also Win 11 and Reaper 7.30.

From small to big: 100%, 125%, 150%

I could not reproduce it in other hiDPI capable hosts. Tested in Cubase 14, Nuendo 13, Bitwig 5.27 and Studio One 6.

On Windows 10 the plugin was not accepted by Reaper 7.30. But when testing with my own resizable plugin the error did not occur.

From the information you’ve provided (buggy behaviour only present in a single REAPER install) it sounds as though the issue is due to the configuration of that REAPER install.

What is REAPER’s current HiDPI mode? Mine was set to Multimonitor aware (recommended), which works as expected. I see similar behaviour to you when switching to Multimonitor aware v2 (experimental).

In the debugger, I see that in the ‘experimental’ mode, REAPER sends the plugin an onSize notification for the new scaled size before setting a new content scale factor, then sets a new scaled size again after applying the content scale factor. This is a REAPER bug, I’d recommend filing it with Cockos.

If the issue is still present in the recommended HiDPI mode (remember to quit and restart after changing modes), then please try to determine whether you have any other REAPER settings active that contribute to the behaviour.

@reuk Checked that and it was on default, like yours. I even switched back and forth and restarted reaper as suggested. Still same behaviour. Usually i use mint and unchanged DAWs for testing. I also checked any other setting possibly related to GUI and i could not find anything which could have an influence.

It might indeed be a Reaper bug. Funnily, in the initial message in this thread i stated that i also had this bug in Cubase 13, which i had. But now i could not reproduce it there, but still reliably in Reaper. I’ll keep an eye on it. Don’t know what more to check.

You could try adding a breakpoint/logging in setContentScaleFactor() and onSize() in juce_audio_plugin_client_VST3.cpp. When dragging the plugin editor between displays, if the plugin receives an onSize with larger bounds before setContentScaleFactor, then the host is attempting to set new bounds without first notifying the plugin that the scale has changed. This is almost certainly a bug in the host, and should be reported to the host developers.

Got it. Will do. Thanks.