diff --git a/src/tools/ecode/ecode.cpp b/src/tools/ecode/ecode.cpp index 44628bafb..9cab88220 100644 --- a/src/tools/ecode/ecode.cpp +++ b/src/tools/ecode/ecode.cpp @@ -3709,15 +3709,13 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe mUISceneNode->runOnMainThread( [path, initialPosition, this] { loadFileFromPathOrFocus( path, true, nullptr, getForcePositionFn( initialPosition ) ); - } ); - if ( !mWindow->hasFocus() ) { - if ( mWindow->isMinimized() ) { - // FIXME: SDL2 seems to very rarely dead-lock on SDL_RestoreWindow call. - // This can create a dead-lock for the file system listener. - mThreadPool->run( [this] { mWindow->restore(); } ); + + if ( !mWindow->hasFocus() ) { + if ( mWindow->isMinimized() ) + mWindow->restore(); + mWindow->raise(); } - mWindow->raise(); - } + } ); } FileSystem::fileRemove( fi.getFilepath() ); } ); diff --git a/src/tools/ecode/statusbuildoutputcontroller.cpp b/src/tools/ecode/statusbuildoutputcontroller.cpp index 81f5077e2..ced4ea2c9 100644 --- a/src/tools/ecode/statusbuildoutputcontroller.cpp +++ b/src/tools/ecode/statusbuildoutputcontroller.cpp @@ -254,8 +254,10 @@ void StatusBuildOutputController::runBuild( const std::string& buildName, updateBuildButton(); - if ( !mApp->getWindow()->hasFocus() ) - mApp->getWindow()->flash( WindowFlashOperation::UntilFocused ); + if ( !mApp->getWindow()->hasFocus() ) { + mApp->getUISceneNode()->runOnMainThread( + [this] { mApp->getWindow()->flash( WindowFlashOperation::UntilFocused ); } ); + } if ( doneFn ) doneFn( exitCode );