Extend thread expansion grace period to half a second.

Previously a framerate-dependent 10 frame count was used.
This commit is contained in:
Bartosz Taudul 2021-08-19 00:24:11 +02:00
parent 38f156259c
commit c82bf3915b
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 18 additions and 3 deletions

View File

@ -1166,7 +1166,21 @@ bool View::DrawImpl()
m_lockInfoAnim.Update( io.DeltaTime );
m_statBuzzAnim.Update( io.DeltaTime );
if( m_firstFrame > 0 ) m_firstFrame--;
if( m_firstFrame )
{
const auto now = std::chrono::high_resolution_clock::now();
if( m_firstFrameTime.time_since_epoch().count() == 0 )
{
m_firstFrameTime = now;
}
else
{
if( std::chrono::duration_cast<std::chrono::milliseconds>( now - m_firstFrameTime ).count() > 500 )
{
m_firstFrame = false;
}
}
}
if( m_reactToCrash )
{
@ -2784,7 +2798,7 @@ void View::AdjustThreadHeight( View::VisData& vis, int oldOffset, int& offset )
}
else if( vis.height < h )
{
if( m_firstFrame > 0 )
if( m_firstFrame )
{
vis.height = h;
offset = oldOffset + h;

View File

@ -485,7 +485,8 @@ private:
UserData m_userData;
bool m_reconnectRequested = false;
int m_firstFrame = 10;
bool m_firstFrame = true;
std::chrono::time_point<std::chrono::high_resolution_clock> m_firstFrameTime;
float m_yDelta;
std::vector<SourceRegex> m_sourceSubstitutions;