Comment 27 for bug 967416

Revision history for this message
Mark Harmer (drivehappy) wrote :

I've attached a proposed patch.

One thing of note is that this actually keeps the Glib::MainLoop, after reading more into it, it appears that a recursive call to running a main loop is supported.

The actual problem is that this was reusing the default MainContext which had all of the original input sources. This patch builds a new MainContext for the new MainLoop, and with each file_listener::init connects the stdout and stderr it to this new context.

This causes the expected blocking UI behavior until the script has completed saving since the new context shouldn't have any other sources. Unfortunately this does cause the UI to appear to be hung until the script completes the save, but given Johan's statement it sounds like it might be a reasonable fix until multithreading can be added.