vcl/unx/kde4/KDEXLib.cxx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
New commits: commit a23231cbff9b18e7d2e02e91e9b674d71b8f39a9 Author: Michael Meeks <michael.me...@collabora.com> Date: Wed Nov 20 13:30:07 2013 +0000 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. diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx index 28dbd5d..67d7a4d 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 ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits