isCurrentlyModal () bug?

Hi Guys,

Checking at isCurrentlyModal () implementation, it only looks for the foremost component instead of all the modal component.
The implementation should probably check on all the modal component from getNumCurrentlyModalComponents ?

I’m troubleshooting some threaded loading command where there is a progress modal dialog and in some case I could have concurent loading leading to multiple modal dialog box.


Hmm, it’s a badly chosen name really… Maybe a better name would have been “isCurrentlyTheModalComponent”, which describes the intention of this method.

We can’t change this kind of thing though, it’d break existing code that relies on the current behaviour.

I don’t mind but exitModalState impl relies on it and hence do not work correctly if there are multiple modal dialog overlapping.
So internal code should probably not use it.

Changing the implementation to check all the modal component fixed my crash.
You can maybe add a parameter
bool onlyCheckforemost
to isCurrentlyModal
and set it to false in calls of juce_component.cpp and juce_threadWithProgressWindow.cpp
and have it default to true.

Thanks !

1 Like

Do you think this is possible to do Jules ?

Sorry, been busy… Yes, sounds like something we should look into!

1 Like

bumpity bump

OK this should be fixed on the develop branch.

Many Thanks !