mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
VST3: Added a workaround for Cubase 10 resizing the host window after the plug-in on macOS
This commit is contained in:
parent
51fed8f8bf
commit
954663b8bb
1 changed files with 27 additions and 0 deletions
|
|
@ -811,6 +811,11 @@ private:
|
|||
editorScaleFactor = ec.lastScaleFactorReceived;
|
||||
|
||||
component.reset (new ContentWrapperComponent (*this, p));
|
||||
|
||||
#if JUCE_MAC
|
||||
if (getHostType().type == PluginHostType::SteinbergCubase10)
|
||||
cubase10Workaround.reset (new Cubase10WindowResizeWorkaround (*this));
|
||||
#endif
|
||||
}
|
||||
|
||||
tresult PLUGIN_API queryInterface (const TUID targetIID, void** obj) override
|
||||
|
|
@ -907,6 +912,11 @@ private:
|
|||
|
||||
component->setSize (w, h);
|
||||
|
||||
#if JUCE_MAC
|
||||
if (cubase10Workaround != nullptr)
|
||||
cubase10Workaround->triggerAsyncUpdate();
|
||||
else
|
||||
#endif
|
||||
if (auto* peer = component->getPeer())
|
||||
peer->updateBounds();
|
||||
}
|
||||
|
|
@ -1211,6 +1221,23 @@ private:
|
|||
#if JUCE_MAC
|
||||
void* macHostWindow = nullptr;
|
||||
bool isNSView = false;
|
||||
|
||||
// On macOS Cubase 10 resizes the host window after calling onSize() resulting in the peer
|
||||
// bounds being a step behind the plug-in. Calling updateBounds() asynchronously seems to fix things...
|
||||
struct Cubase10WindowResizeWorkaround : public AsyncUpdater
|
||||
{
|
||||
Cubase10WindowResizeWorkaround (JuceVST3Editor& o) : owner (o) {}
|
||||
|
||||
void handleAsyncUpdate() override
|
||||
{
|
||||
if (auto* peer = owner.component->getPeer())
|
||||
peer->updateBounds();
|
||||
}
|
||||
|
||||
JuceVST3Editor& owner;
|
||||
};
|
||||
|
||||
std::unique_ptr<Cubase10WindowResizeWorkaround> cubase10Workaround;
|
||||
#endif
|
||||
|
||||
float editorScaleFactor = 1.0f;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue