MidiKeyboardComponent - internalRepaintUnchecked issues

Not sure what’s causing this, started to use the MIDI keyboard component and now randomly seeing these repaint issues, triggered by pressing keys. I’m not calling any repaints in my code, this is thrown upstream of my classes. Thanks a bunch.

void Component::internalRepaintUnchecked (Rectangle< int > area, bool isEntireComponent)

{

// if component methods are being called from threads other than the message

// thread, you’ll need to use a MessageManagerLock object to make sure it’s thread-safe.

JUCE_ASSERT_MESSAGE_MANAGER_IS_LOCKED

Did you take a look at the call stack when your debugger stops at this line? This should make it a bit clearer where that function call is triggered from.

Yes, I may not have gone far back enough though. The sequence is essentially that a ValueTree property change broadcast on startNote() eventually ends up changing the enablement status of a UI component (enablementChanged()), which in turn triggers a repaint, and that’s where it falls apart.

  1. startNote() -> changes ValueTree property, broadcasts the change (sendPropertyChangeMessage())
  2. UI component is a parameter change listener -> updates its enablement status (enablementChanged()) based on the note-specific parameter
  3. juce::component upstream eventually triggers a repaint() and this is where it fails.