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

VST hosting: tweaked the way 64-bit plugin NSViews are created, to avoid an extra intermediate parent NSView which seems to break some plugins.

This commit is contained in:
jules 2014-07-24 11:24:57 +01:00
parent 705492a800
commit 7c0d0ae677

View file

@ -112,27 +112,24 @@ struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewCompone
setView (v);
[v release];
startTimer (100);
startTimer (30);
}
NSView* getChildView() const
{
if (NSView* parent = (NSView*) getView())
if ([[parent subviews] count] > 0)
return [[parent subviews] objectAtIndex: 0];
return nil;
}
void timerCallback() override
{
if (NSView* parent = (NSView*) getView())
if (NSView* child = getChildView())
{
if ([[parent subviews] count] > 0)
{
if (NSView* child = [[parent subviews] objectAtIndex: 0])
{
NSRect f = [parent frame];
NSSize newSize = [child frame].size;
if (f.size.width != newSize.width || f.size.height != newSize.height)
{
f.size = newSize;
[parent setFrame: f];
}
}
}
stopTimer();
setView (child);
}
}
};