diff --git a/modules/juce_audio_processors/juce_audio_processors.cpp b/modules/juce_audio_processors/juce_audio_processors.cpp index 78d3387670..43934d6ca7 100644 --- a/modules/juce_audio_processors/juce_audio_processors.cpp +++ b/modules/juce_audio_processors/juce_audio_processors.cpp @@ -112,27 +112,24 @@ struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewCompone setView (v); [v release]; - startTimer (100); + startTimer (30); } - void timerCallback() override + NSView* getChildView() const { if (NSView* parent = (NSView*) getView()) - { 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]; - } - } - } + return [[parent subviews] objectAtIndex: 0]; + + return nil; + } + + void timerCallback() override + { + if (NSView* child = getChildView()) + { + stopTimer(); + setView (child); } } };