Display update problem


#1

I have been working on a large mixer project for quite some time.  It on my display I have multiple dialogs open mix, masters, channels stip...  I am using a midi controller as well.  The maincontentcompoent is  the mix currently with 48 channel faders, pans and buttons.  This dialog can switch it;s content to display auxes or the main mix.

There is master dialog that has master fader, pan and buttons.  One being the select button.  When I click it the view is changed on the MainContentcomponent to reflect the mix (main on auxes) on the its display.  I also have a set of buttons on the midi controller to select the mix I want see.

The strange thing is when I select a mix from the cotroller, sometimes the maincontentcomponent fails to update.  The moviing faders on my controller move, but the display does not change.  If I move a fader on the midi controller, I can hear the volume change so I know it work but the display still does not update.  But if I simply click on the compoent, it immediately updates.

The midi message is recieived, and sent to the master component via callFunctionOnMessageThread.  This function calls a function in the component called UpdateView().  This changes to view by updating each of the components on the display. 

I have tried calling repaint(), tofront() other things.  It appears to me like it thinks the display is hidden so it does not need to repaint the component until I click on it.   I don't understand why this behaves this way.  Just wondering if I am missing some operation to make this work or if there is/was bug in Juce. 

 

Thanks if advance for any ideas or suggestsions on how to fix or diagnose the problem.

Mark.

 


#2

I am still trying to figure this out.  Clicking on the window makes it update.  But I just noticed if I hover over a object that has a tool tip and wait for the tool tip to display, as soon as I move the mouse away from that object, the window will paint properly.  It appears to be related to the fact I am initiating this from a back ground thread.  Any ideas?

(I forgot to mention this is windows 7, with Juce about 6 months old)


#3

Found the problem.  I was not locking the message queue before sending the message.  The system I am building on does not have the midi controller so I needed to test on a different system which I normally run in release mode.  Moved the source over tried a few in debug mode and got an assert saying I needed to lock the message queue.  The original code did not assert. go figure.  So I added a lock and problem went away.  This code has been this way for a year or more it seems strange I never saw the problem before.