mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
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.
This commit is contained in:
parent
b27af5def9
commit
e0fd976779
1 changed files with 7 additions and 7 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue