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:
parent
705492a800
commit
7c0d0ae677
1 changed files with 13 additions and 16 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue