Native File Browser and MessageManager


#1

We are seeing problems with Message Manager Loop and native Linux filebrowsers. The github issue isn’t seeing any love so I am opening a thread here. Copied from issue:

It would be nice if the native FileChooser dialog did not block the message thread while waiting for the child process to exit. This halts numerous things in the system which you would expect to remain running in the background with a dialog box active, eg: Timers & OpenGLRenderer. The following code shows an example of a possible fix:

juce_linux_FileChooser.cpp::FileChooser::showPlatformDialog()

...
if (child.start (args, ChildProcess::wantStdOut))
{
    if (MessageManager::getInstance()->isThisTheMessageThread())
    {
        while (child.isRunning())
        {
            if (!MessageManager::getInstance()->runDispatchLoopUntil(20))
                break;
        }
    }
    
    const String result (child.readAllProcessOutput().trim());

    if (result.isNotEmpty())
    {
    ...

#2

This has been fixed on the develop branch.


#3

Thanks Tom