You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
2.3KB

  1. diff --git a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  2. index 4a62a262b..e00d02fbe 100644
  3. --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  4. +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  5. @@ -1177,8 +1177,26 @@ private:
  6. if (size != nullptr && component != nullptr)
  7. {
  8. auto editorBounds = component->getSizeToContainChild();
  9. + auto width = editorBounds.getWidth();
  10. + auto height = editorBounds.getHeight();
  11. - *size = convertToHostBounds ({ 0, 0, editorBounds.getWidth(), editorBounds.getHeight() });
  12. + #if JUCE_LINUX
  13. + if (component != nullptr)
  14. + {
  15. + if (auto* peer = component->getPeer())
  16. + {
  17. + auto scale = (float) peer->getPlatformScaleFactor();
  18. +
  19. + if (! approximatelyEqual (scale, 1.0f))
  20. + {
  21. + width *= scale;
  22. + height *= scale;
  23. + }
  24. + }
  25. + }
  26. + #endif
  27. +
  28. + *size = convertToHostBounds ({ 0, 0, width, height });
  29. return kResultTrue;
  30. }
  31. @@ -1464,7 +1482,19 @@ private:
  32. if (owner.plugFrame != nullptr)
  33. {
  34. - auto newSize = convertToHostBounds ({ 0, 0, b.getWidth(), b.getHeight() });
  35. + #if JUCE_LINUX
  36. + if (auto* peer = getPeer())
  37. + {
  38. + auto scale = (float) peer->getPlatformScaleFactor();
  39. +
  40. + if (! approximatelyEqual (scale, 1.0f))
  41. + {
  42. + w *= scale;
  43. + h *= scale;
  44. + }
  45. + }
  46. + #endif
  47. + auto newSize = convertToHostBounds ({ 0, 0, w, h });
  48. {
  49. const ScopedValueSetter<bool> resizingParentSetter (resizingParent, true);