If a Juce application goes into a modal state in its JUCEApplication::initialise() function, and another instance is started, anotherInstanceStarted() doesn’t get called. This happens regardless of the return value of moreThanOneInstanceAllowed().
I might guess the reason is that the message loop doesn’t deliver the ActionListener message while in the modal state but to be honest, it all looks complicated to me and I am unsure.
My goal is to display an AlertWindow indicating to the user that a second instance is not allowed, since I take over the audio hardware. During initialise() there could be a lengthy startup for which I want progress or something. It is also possible that initialise() will fail and I am in the middle of showing an AlertWindow indicating the reason.