I’m sorry if this has been covered before, but I couldn’t find it in a search. I’m using the non-modules “bleeding edge” of JUCE (1.54.27) and am seeing a subtle, but sometimes problematic, behavior on Mac with left mouse clicks and popup menus.
An easy way to see the issue is to modify the Table demo in JUCE demo. Put a text button just above the table. When the button is clicked, create a popup menu that is long enough to overlap the table header (you can just use the popup menu example from the Widgets demo). Under Windows, the popup menu works as expected. It displays, you click, and it dismisses. Under Mac, the menu still behaves normally, but the Table header bar will respond to the left mouse click used to select a menu item over it.
This is problematic in that you have to be careful about popup menus appearing over controls (or at least certain controls, in the case above, the table header will respond to left mouse clicks in the menu, but the table will not). Again, I’m sorry if this has been covered before. I can post a tweaked Table demo .cpp/.h that demonstrates the problem if nec.
See the enclosed. I simply modified TableView.cpp from JUCEDemo (changes marked with !!!). The image shows a mouse down, notice that the table column header under the menu reacts to the mouse down even though the menu is over it. In this case, the bug is just cosmetic (since I throw up a message box in response to the menu, the highlight will get stuck), but I’ve had other controls act strangely.
Built with XCode 4.1, no settings changed.
Let me know if there is any other info I can provide.
FWIW, you don’t need any altered code at all, just click on a regular menu over the table header in the unaltered JUCEDemo. The only reason I modified it is that the view generally changes when you click a normal menu.
It is interesting to me that the behavior is different in Windows and Mac. Also, I see some similar oddities with popup menus over some other controls (and, again, only on Mac).
FWIW, by “interesting” I meant “interesting, if the bug is in the control, then there must be something subtle about mouse message dispatching or something between platforms…” not ‘are you SURE that it is a bug in the control…’
I’ll be interested in looking at the fix. Normally, this is the sort of thing where I’d set a break point deep down and walk my way through to get more familiar with the environment, but I just haven’t had time.
I did see similar issues with some other controls, I’ll go back and create some simple examples for each of them and pass them on.