Skip to content

Commit

Permalink
TProgram: fix event wait timeout when eventTimeoutMs is negative
Browse files Browse the repository at this point in the history
  • Loading branch information
magiblot committed Oct 25, 2024
1 parent 176cd4b commit e9a9dda
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions source/tvision/tprogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@ Boolean TProgram::canMoveFocus()

int TProgram::eventWaitTimeout()
{
int timerTimeoutMs = min(timerQueue.timeUntilNextTimeout(), (int32_t) INT_MAX);
if (timerTimeoutMs < 0)
int timerTimeoutMs = min( timerQueue.timeUntilNextTimeout(), (int32_t) INT_MAX );
if( timerTimeoutMs < 0 )
return eventTimeoutMs;
return min(eventTimeoutMs, timerTimeoutMs);
if( eventTimeoutMs < 0 )
return timerTimeoutMs;
return min( eventTimeoutMs, timerTimeoutMs );
}

ushort TProgram::executeDialog( TDialog* pD, void* data )
Expand Down

0 comments on commit e9a9dda

Please sign in to comment.