Browse Source

VST2: Always request a resize from the host when attaching an editor

This fixes an issue in Live 11.2 where editors using OpenGL would be
scaled incorrectly after closing and reopening the editor.
v7.0.9
reuk 2 years ago
parent
commit
e0fd976779
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp

+ 7
- 7
modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp View File

@@ -1019,7 +1019,7 @@ public:
// before that happens.
X11Symbols::getInstance()->xFlush (display);
#elif JUCE_WINDOWS && JUCE_WIN_PER_MONITOR_DPI_AWARE
checkHostWindowScaleFactor();
checkHostWindowScaleFactor (true);
startTimer (500);
#endif
#elif JUCE_MAC
@@ -1223,12 +1223,12 @@ public:
}
#if JUCE_WIN_PER_MONITOR_DPI_AWARE
void checkHostWindowScaleFactor()
void checkHostWindowScaleFactor (bool force = false)
{
auto hostWindowScale = (float) getScaleFactorForWindow ((HostWindowType) hostWindow);
if (hostWindowScale > 0.0f && ! approximatelyEqual (hostWindowScale, wrapper.editorScaleFactor))
wrapper.handleSetContentScaleFactor (hostWindowScale);
if (force || (hostWindowScale > 0.0f && ! approximatelyEqual (hostWindowScale, wrapper.editorScaleFactor)))
wrapper.handleSetContentScaleFactor (hostWindowScale, force);
}
void timerCallback() override
@@ -2013,7 +2013,7 @@ private:
return 0;
}
pointer_sized_int handleSetContentScaleFactor (float scale)
pointer_sized_int handleSetContentScaleFactor (float scale, bool force = false)
{
checkWhetherMessageThreadIsCorrect();
#if JUCE_LINUX || JUCE_BSD
@@ -2023,7 +2023,7 @@ private:
#endif
#if ! JUCE_MAC
if (! approximatelyEqual (scale, editorScaleFactor))
if (force || ! approximatelyEqual (scale, editorScaleFactor))
{
editorScaleFactor = scale;
@@ -2032,7 +2032,7 @@ private:
}
#else
ignoreUnused (scale);
ignoreUnused (scale, force);
#endif
return 1;


Loading…
Cancel
Save