I haven't checked your patch and what exactly happens in Geany yet but wouldn't it be possible to just add `g_idle_add()` (or better `plugin_idle_add()`) to the "project-open" handler and do what is done now in the idle callback? Geany could then open the files before the idle callback is called.