diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2013-11-20 13:30:07 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2013-11-20 13:30:07 +0000 |
commit | a23231cbff9b18e7d2e02e91e9b674d71b8f39a9 (patch) | |
tree | 70b86e6252f3452e0a55bf6a5e9422641c055c1b /vcl | |
parent | 20f029c653abbd7578ceee968065f4c5d66f375f (diff) |
Revert "Simplify KDE4 yielding."
This reverts commit 20f029c653abbd7578ceee968065f4c5d66f375f.
The native X11 and gtk+ backends both have this functionality,
and both with a hard-coded 100, and the gtk+ one has had active
maintenance and testing. I'd like to leave that there, I suspect
it is used in some obscure multi-threaded corner-case where we
want to process events but only a few of them.
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/kde4/KDEXLib.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx index 28dbd5d63b99..67d7a4d4f31e 100644 --- a/vcl/unx/kde4/KDEXLib.cxx +++ b/vcl/unx/kde4/KDEXLib.cxx @@ -329,16 +329,20 @@ void KDEXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) } } -// Qts processEvent always processes all pending events, -// so we can ignore the second parameter 'bHandleAllCurrentEvents'. -void KDEXLib::processYield( bool bWait, bool ) +void KDEXLib::processYield( bool bWait, bool bHandleAllCurrentEvents ) { - QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance( qApp->thread() ); - - if ( bWait ) + QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance( qApp->thread()); + bool wasEvent = false; + for( int cnt = bHandleAllCurrentEvents ? 100 : 1; + cnt > 0; + --cnt ) + { + if( !dispatcher->processEvents( QEventLoop::AllEvents )) + break; + wasEvent = true; + } + if( bWait && !wasEvent ) dispatcher->processEvents( QEventLoop::WaitForMoreEvents ); - else - dispatcher->processEvents( QEventLoop::AllEvents ); } void KDEXLib::StartTimer( sal_uLong nMS ) |