macOS Repaint throttling - small change, big effect!

If a component is repainted with 30fps interval (which is the half of the “normal” fps rate of most computers), and we use a timer to trigger the repaint, it can relativ often happen that the repaint throttling will delay the repaint, the result is, that we miss the v-sync completely and the animation will stutter.

The solution is quite simple, could somebody from the juce team, decrease the minimum interval a little bit?

in juce_mac_NSViewComponentPeer.mm
static uint32 minimumRepaintInterval = 1000 / 32; // 32fps instead 30fps

4 Likes

A macro like this would do the job too. @ed95 ?

#ifndef MACOS_MAXIMUM_REPAINT_FREQUENCY
      #define MACOS_MAXIMUM_REPAINT_FREQUENCY 30
#endif
         
static uint32 minimumRepaintInterval = 1000 / MACOS_MAXIMUM_REPAINT_FREQUENCY;
3 Likes

just in case it was forgotten, bump

2 Likes

I’d love the possibility to customize that with a macro instead of it being magically hardcoded in the JUCE codebase

1 Like

Bump

Could the JUCE team please consider this?

It’s a small, reasonable change that allows other developers to tweak the limit at their own risk, without breaking the current behavior that remains as the default

3 Likes

We’ve also been asking for an option to adjust the limit for a while (e.g. Juce Plugins capped at 30 fps, with clipping bugs?) — would love to see that change.

2 Likes