mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-06-02 03:26:29 +03:00
Running window calls in the main thread seems to fix dead-lock issues.
This commit is contained in:
@@ -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() );
|
||||
} );
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user