My debug prints don’t verify, that the editor is constructed before the setStateInformation, I would claim it is a red herring. It was just the case, if setResizeLimits is called, it will resize with the minimum size due to this code:
If no size was set before, it will set to minimum size, constraining a size of 0/0.
So actually to add to my previous post, it works even better just to call the setSize before the constrainer:
Thanks for the feedback. I tested in Logic, so seems that FL Studio behaves different.
If you have still problems, maybe try to output in your test the address of the instance (or what I do sometimes is adding a Uuid as a member), just to be sure that it is really the editor of that instance. Some hosts create test instances for the plugin and editor to do some checks for whatever reason (like opening the editor twice and similar, that was reported here on the forum).
In VST3 the constructor is called before setStateInformation - with VST2 the constructor is called after, and as you confirmed with Logic, so is AU.
I’m just about to roll back to 5.3.2, to test how it used to be…
I doubt it is related to the juce wrapper, but rather how the host implements the different plugin formats.
So I take it the code I suggested doesn’t solve your problem?
There would also be the option to have a flag to identify, if the state was loaded before, and only in that case you would apply the size. But that is really hacky…
Yes, since you are checking if it is not nullptr. One should assume that destruction of the editor happens from the message thread. So yes, if you call that, ensure you are on the message thread as well (usually the case for setStateInformation, I don’t know about guarantees though).
An exception I can remember is FinalCut, which has multiple background instances to render the waveform. In this case all happens from one thread, which is not the message thread. But then there is never an editor involved, so it should be safe as well…
Oh you’re quite right I had already tried it, I’m sorry.
Has anyone tried VST 2 scaling, with the develop branch? Mine is totally screwed now (yes, this is a clean clone with no local changes) edit I’ve now gone back to the 5.3.2 zip download of Juce. The above fixes still work for me.
What issues are you running into specifically? I’ve got a few fixes for the Windows scaling that should be on the develop branch soon but it’d be useful if you could send over examples of the issues you’re having.
OK, I just discovered that you need to test Windows scaling again. Right click desktop/ Display Settings / ‘Scale and layout’ / ‘Change the size of text, app and other items’ to 150% - then you’ll see it. I’ll send an example of just background graphic going wrong in a minute or so. Where is the best place to post it?