Windows: DPI Awareness of DocumentWindow assumed

Hi Guys,

a plugin window usually is DPI aware if the host provides such info. Now, if a plugin, in this case VST3 on Windows, opens a DocumentWindow by itself without having the Editor open, there is no component to which the Document can refer to and therefore it is not DPI aware. But on Mac it is. (The usecase is that the plugin gets triggered remotely to show it’s GUI.)

Is there a way to achieve this on Windows as well?


Bump. It actually feels like a bug since the behaviour expected by the user would be DPI awareness. After experimenting with an older Juce version and this High DPI support for non-plugins on Windows i found that it is generally possible to make the DocumentWindow DPI aware when launched by a plugin but unfortunately it destroys the correct behaviour of the plugin editor.

@reuk (or others in the team): Would it be possible to conceive of a fix for that inside regular juce?

Have you checked the HostPluginDemo? That demo shows how to open a new DocumentWindow with a scale that matches the main editor.

Yes. The point here is, that i want to open a DocumentWindow WITHOUT having the editor window open to which I can associate the window and therefore get DPI awareness. The usecase is that I want to remotely trigger a plugin to show a window without the editor being open. That works on both systems, on Mac it is even DPI aware but on Windows it is not.

I see. That’s not possible at the moment. Changing this behaviour would mean overhauling a big chunk of the Windows scaling code. It’s something I’d like to do at some point for improved consistency with standalone apps, but it’s also likely to be a time-consuming breaking change, so I don’t see it happening in the near future.


@CarlColijn Would you have any suggestion on that?

Unfortunately not. I’m still using the fix you already found. Fortunately my plugins only need to work in the “dumb host” situation (i.e.: fend for themselves regarding DPI awareness), so my DPI fix to Juce is all I need. Unfortunately though, Juce has moved on quite a bit since 6.0.5 on which my fix was based, including the DPI awareness part. So I’m either stuck with version 6.0.5, or I have to re-engineer that fix again for the now latest version. I thus decided to wait it out until Juce gets it’s DPI straight instead or until 6.0.5 is outdated enough I’m forced to upgrade.

Yeah, i am on 6.1.6 still and will also upgrade only once I really need it. And I saw that between 6.0.5 and 6.1.6 some changes were introduced to the file where your fix is. I tried to apply your fix but I could only get one thing working at a time, either the normal plugin window opened by the host was working as it should, or the DocumentWindow, but not both at the same time. Did you have a look at 6.1.6 at some point?

I indeed also found out the same thing when trying to migrate to a newer version, though I’m unsure which version that was (it was at least a couple of months ago IIRC). But my priorities are not in that area either at the moment, so it’ll take a while before I’ll have another look at it.