UI scaling on Windows 4k

Yep! They’ll scale “correctly” if you override the following in your LookAndFeel:

Component* UALookAndFeel::getParentComponentForMenuOptions(const PopupMenu::Options& options)
{
#if JUCE_IOS
	if (PluginHostType::getPluginLoadedAs() == AudioProcessor::wrapperType_AudioUnitv3)
	{
		if (options.getParentComponent() == nullptr && options.getTargetComponent() != nullptr)
			return options.getTargetComponent()->getTopLevelComponent();
	}
#else
    if (options.getParentComponent() == nullptr && options.getTargetComponent() != nullptr)
    {
        return options.getTargetComponent()->getParentComponent();
        //return options.getTargetComponent()->getTopLevelComponent();
    }
#endif
    return LookAndFeel_V2::getParentComponentForMenuOptions(options);
}

But then you run into a different issue…

At the moment, there doesn’t seem to be a great solution for bug-free interface scaling that we’ve found. We’ve settled for AffineTransform with unscaled PopupMenus until that bug gets fixed.

1 Like