Secondary Window launched from plugin gets incorrect monitor scaling

I’ve created a simple plugin project to demonstrate an issue I’m having (on Windows 10). JUCE 6.1.6. You click a button in the plugin window to open a secondary window. (30.4 KB)

My plugin can launch a few separate windows - for debugging purposes. I know it is not recommended to have additional windows in a released plugin.

But in any case, when I run the display with Display Scaling at 100%, the secondary window opens the correct size (same as the main plugin in this example project):


When I set the Windows Display Scaling to 150%, the AudioPluginHost and the plugin’s window open at the same size, but the secondary window opens at 75%:


Is there something I should be doing to fix this?

I had a similar issue for extra windows with hdpi monitors. I solved it in a similar way as it has been solved for Tooltip and Alert windows:

In my document window:

    /** @internal */
    float getDesktopScaleFactor() const override {
        return scale * Desktop::getInstance().getGlobalScaleFactor();

where scale is a member variable which I set in the window constructor with a value passed in by the main editor window:

showSecondWindow (){
    float scale = Component::getApproximateScaleFactorForComponent( this );
    newWindow = std::make_unique<MyDocumentWindow>(scale);
1 Like

@Bgraf - thank you! I tried this and it works.