AlertWindow & thread


#1

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.


#2

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


#3

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.


#4

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…


#5

Works, thanks


#6