Check for activity in View.

This commit is contained in:
Bartosz Taudul 2022-09-28 00:26:03 +02:00
parent a8276c41c3
commit b3e9a03856
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -271,6 +271,12 @@ static void DrawContents()
bptr->NewFrame( display_w, display_h ); bptr->NewFrame( display_w, display_h );
static int activeFrames = 3; static int activeFrames = 3;
if( view && view->WasActive() )
{
activeFrames = 3;
}
else
{
auto& inputQueue = ImGui::GetCurrentContext()->InputEventsQueue; auto& inputQueue = ImGui::GetCurrentContext()->InputEventsQueue;
if( !inputQueue.empty() ) if( !inputQueue.empty() )
{ {
@ -283,6 +289,7 @@ static void DrawContents()
} }
} }
} }
}
if( activeFrames == 0 ) if( activeFrames == 0 )
{ {
std::this_thread::sleep_for( std::chrono::milliseconds( 16 ) ); std::this_thread::sleep_for( std::chrono::milliseconds( 16 ) );