AlertWindow & thread

Is it possible to create an alertwindow from the non-gui thread? It looks like Component::runModalLoop() is designed to handle it, but addToDesktop() seems to deadlock when called from a non-gui thread.

It should be possible - what’s it deadlocking with?

Component::addToDesktop requires the MessageManager to be locked.

But then the constructor for Win32ComponentPeer calls MessageManager::callFunctionOnMessageThread() to create a window which deadlocks because the thread is in the message manager lock.

This is actually an absolute nightmare because of win32’s requirement that only one thread can do certain things to a window.

The only way I can find to do it is by altering AlertWindow, which I’ve done now and checked it in - have a go and check that it’s working for you…

Works, thanks