From 784909a789f9ba7eb7cf7a6dbf5d8172f49bcc97 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 31 Mar 2011 14:37:25 +0200 Subject: impress211: #i116339# implement bHandleAllCurrentEvents Conflicts: vcl/unx/generic/app/saldata.cxx --- vcl/unx/generic/app/saldata.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'vcl') diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx index 0596dce454d7..58a89578eae6 100644 --- a/vcl/unx/generic/app/saldata.cxx +++ b/vcl/unx/generic/app/saldata.cxx @@ -681,6 +681,8 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) if (p_prioritize_timer != NULL) CheckTimeout(); + const int nMaxEvents = bHandleAllCurrentEvents ? 100 : 1; + // first, check for already queued events. for ( int nFD = 0; nFD < nFDs_; nFD++ ) { @@ -688,10 +690,11 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) if ( pEntry->fd ) { DBG_ASSERT( nFD == pEntry->fd, "wrong fd in Yield()" ); - if ( pEntry->HasPendingEvent() ) + for( int i = 0; i < nMaxEvents && pEntry->HasPendingEvent(); i++ ) { pEntry->HandleNextEvent(); - return; + if( ! bHandleAllCurrentEvents ) + return; } } } @@ -778,7 +781,6 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) } if ( FD_ISSET( nFD, &ReadFDS ) ) { - int nMaxEvents = bHandleAllCurrentEvents ? 100 : 1; for( int i = 0; pEntry->IsEventQueued() && i < nMaxEvents; i++ ) { pEntry->HandleNextEvent(); -- cgit