Infinite re-paint with AU in Reaper on OS X El Capitan


I’ve ported a VST plugin from Windows to an AU plugin on OS X and I’m having trouble with the UI. Sometimes the UI is repainted constantly even when I don’t touch it. This leads to more than 90% of CPU usage with a single loaded plugin that just sits there. Furthermore the UI becomes hard to use. ComboBoxes in particular won’t work reliably. They open instantly but don’t close right away when one of the items is clicked.
Our UI doesn’t have any component that needs constant updates, so when the user isn’t doing anything no re-paints should be necessary.
I don’t know if this is caused by my code, JUCE or Reaper. I’ve run Reaper in “Instruments” and will attach a screenshot. Does anyone have an idea what might be going on here?

Maybe set some breakpoints inside the Component::repaint method to see whether it’s your code that’s triggering the repaints?

I feel stupid now. Thanks! :wink:
I should have thought of that myself. And indeed it is my code that’s triggering the repaints. Let me explain what I’m doing. I have text labels in front of some UI components that I want to highlight when the corresponding component has the input focus. So I trigger a repaint of the label whenever the component is repainted. On Windows this worked, but on OS X the repainting of the label seems to trigger another repaint of the original component. They don’t overlap, I checked that.
Now I need a better way to trigger the label-repaint. I guess it wasn’t a good idea at all to call any kind of repaint function inside a paint function, even for non-overlapping sibling components.
I’ll probably use the focus callbacks from now on, unless you can think of a better method.