1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-23 01:44:22 +00:00

Fix for Ableton plugin window resizing issues.

This commit is contained in:
jules 2015-03-30 12:46:38 +01:00
parent e84797b508
commit 4eecccfd92

View file

@ -256,6 +256,7 @@ public:
isProcessing (false),
isBypassed (false),
hasShutdown (false),
isInSizeWindow (false),
firstProcessCallback (true),
shouldDeleteEditor (false),
#if JUCE_64BIT
@ -1245,7 +1246,16 @@ public:
{
if (editorComp != nullptr)
{
if (! (canHostDo (const_cast<char*> ("sizeWindow")) && sizeWindow (newWidth, newHeight)))
bool sizeWasSuccessful = false;
if (canHostDo (const_cast<char*> ("sizeWindow")))
{
isInSizeWindow = true;
sizeWasSuccessful = sizeWindow (newWidth, newHeight);
isInSizeWindow = false;
}
if (! sizeWasSuccessful)
{
// some hosts don't support the sizeWindow call, so do it manually..
#if JUCE_MAC
@ -1375,27 +1385,30 @@ public:
void childBoundsChanged (Component* child) override
{
child->setTopLeftPosition (0, 0);
if (! wrapper.isInSizeWindow)
{
child->setTopLeftPosition (0, 0);
const int cw = child->getWidth();
const int ch = child->getHeight();
const int cw = child->getWidth();
const int ch = child->getHeight();
#if JUCE_MAC
if (wrapper.useNSView)
setTopLeftPosition (0, getHeight() - ch);
#endif
#if JUCE_MAC
if (wrapper.useNSView)
setTopLeftPosition (0, getHeight() - ch);
#endif
wrapper.resizeHostWindow (cw, ch);
wrapper.resizeHostWindow (cw, ch);
#if ! JUCE_LINUX // setSize() on linux causes renoise and energyxt to fail.
setSize (cw, ch);
#else
XResizeWindow (display, (Window) getWindowHandle(), cw, ch);
#endif
#if ! JUCE_LINUX // setSize() on linux causes renoise and energyxt to fail.
setSize (cw, ch);
#else
XResizeWindow (display, (Window) getWindowHandle(), cw, ch);
#endif
#if JUCE_MAC
wrapper.resizeHostWindow (cw, ch); // (doing this a second time seems to be necessary in tracktion)
#endif
#if JUCE_MAC
wrapper.resizeHostWindow (cw, ch); // (doing this a second time seems to be necessary in tracktion)
#endif
}
}
void handleAsyncUpdate() override
@ -1442,7 +1455,7 @@ private:
VSTMidiEventList outgoingEvents;
VstSpeakerArrangementType speakerIn, speakerOut;
int numInChans, numOutChans;
bool isProcessing, isBypassed, hasShutdown, firstProcessCallback;
bool isProcessing, isBypassed, hasShutdown, isInSizeWindow, firstProcessCallback;
bool shouldDeleteEditor, useNSView;
HeapBlock<float*> channels;
Array<float*> tempChannels; // see note in processReplacing()