There is a big CPU hit using PopuMenu in the SVN version
Try this:
Open Windows Task Manager,
Run Juce Demo using the current tip
Open the look and feel menu for example, the CPU will jump to either 50% or 100% depending if you have a dual processor or a mono.
Do the same thing using the precompiled juce demo from the website,
the CPU stay low.
maybe in MessageManager::runDispatchLoopUntil
we should add Thread::sleep(millisecondsToRunFor)
if juce_dispatchNextMessageOnSystemQueue returns false ?
Well, not really - the millisecsToWaitFor is how long the whole method is allowed to take - there’d be no point locking it up for the whole duration, when other methods might be arriving.
But you’re right that the end time should be taken into account - I think I’ll go for this:
if (! juce_dispatchNextMessageOnSystemQueue (millisecondsToRunFor >= 0))
{
const int msToWait = (int) (endTime - Time::currentTimeMillis());
if (msToWait > 0)
Thread::sleep (jmin (5, msToWait));
}
[quote=“otristan”]Sounds good to me.
As it didn’t happen in older version of Juce, do you remember what might have caused this code modification ?[/quote]
I redesigned the way modal loops work as part of the cocoa updates.