mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
VST3: Scale the ContextMenu coords correctly in DPI-aware hosts
This commit is contained in:
parent
d00d23139c
commit
a8e592d8a8
1 changed files with 12 additions and 0 deletions
|
|
@ -3026,7 +3026,19 @@ tresult VST3HostContext::ContextMenu::popup (Steinberg::UCoord x, Steinberg::UCo
|
|||
PopupMenu::Options options;
|
||||
|
||||
if (auto* ed = owner.getActiveEditor())
|
||||
{
|
||||
#if JUCE_WINDOWS && JUCE_WIN_PER_MONITOR_DPI_AWARE
|
||||
if (auto* peer = ed->getPeer())
|
||||
{
|
||||
auto scale = peer->getPlatformScaleFactor();
|
||||
|
||||
x = roundToInt (x / scale);
|
||||
y = roundToInt (y / scale);
|
||||
}
|
||||
#endif
|
||||
|
||||
options = options.withTargetScreenArea (ed->getScreenBounds().translated ((int) x, (int) y).withSize (1, 1));
|
||||
}
|
||||
|
||||
#if JUCE_MODAL_LOOPS_PERMITTED
|
||||
// Unfortunately, Steinberg's docs explicitly say this should be modal..
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue