Kaydet (Commit) 784909a7 authored tarafından Philipp Lohmann [pl]'s avatar Philipp Lohmann [pl] Kaydeden (comit) Michael Meeks

impress211: #i116339# implement bHandleAllCurrentEvents

Conflicts:
	vcl/unx/generic/app/saldata.cxx
üst 13832248
...@@ -681,6 +681,8 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) ...@@ -681,6 +681,8 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents )
if (p_prioritize_timer != NULL) if (p_prioritize_timer != NULL)
CheckTimeout(); CheckTimeout();
const int nMaxEvents = bHandleAllCurrentEvents ? 100 : 1;
// first, check for already queued events. // first, check for already queued events.
for ( int nFD = 0; nFD < nFDs_; nFD++ ) for ( int nFD = 0; nFD < nFDs_; nFD++ )
{ {
...@@ -688,10 +690,11 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) ...@@ -688,10 +690,11 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents )
if ( pEntry->fd ) if ( pEntry->fd )
{ {
DBG_ASSERT( nFD == pEntry->fd, "wrong fd in Yield()" ); DBG_ASSERT( nFD == pEntry->fd, "wrong fd in Yield()" );
if ( pEntry->HasPendingEvent() ) for( int i = 0; i < nMaxEvents && pEntry->HasPendingEvent(); i++ )
{ {
pEntry->HandleNextEvent(); pEntry->HandleNextEvent();
return; if( ! bHandleAllCurrentEvents )
return;
} }
} }
} }
...@@ -778,7 +781,6 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) ...@@ -778,7 +781,6 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents )
} }
if ( FD_ISSET( nFD, &ReadFDS ) ) if ( FD_ISSET( nFD, &ReadFDS ) )
{ {
int nMaxEvents = bHandleAllCurrentEvents ? 100 : 1;
for( int i = 0; pEntry->IsEventQueued() && i < nMaxEvents; i++ ) for( int i = 0; pEntry->IsEventQueued() && i < nMaxEvents; i++ )
{ {
pEntry->HandleNextEvent(); pEntry->HandleNextEvent();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment