diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2010-10-15 12:31:41 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2010-10-15 14:20:30 +0200 |
commit | 31de11d1439d5aa7f25d9bee253de907c4a62d4e (patch) | |
tree | e3d98820646cfe27606469ababc8efee8b362390 /vcl/unx | |
parent | c678b690a2c663739d8d364de1ddbf68928c5c83 (diff) |
try to process Qt events even when not using Qt event loop
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/kde4/KDEXLib.cxx | 13 | ||||
-rw-r--r-- | vcl/unx/kde4/KDEXLib.hxx | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx index 92cdb579d860..f4519b301c99 100644 --- a/vcl/unx/kde4/KDEXLib.cxx +++ b/vcl/unx/kde4/KDEXLib.cxx @@ -266,7 +266,15 @@ void KDEXLib::socketNotifierActivated( int fd ) void KDEXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) { if( eventLoopType == LibreOfficeEventLoop ) + { + if( qApp->thread() == QThread::currentThread()) + { + // even if we use the LO event loop, still process Qt's events, + // otherwise they can remain unhandled for quite a long while + processYield( false, bHandleAllCurrentEvents ); + } return SalXLib::Yield( bWait, bHandleAllCurrentEvents ); + } // if we are the main thread (which is where the event processing is done), // good, just do it if( qApp->thread() == QThread::currentThread()) @@ -278,7 +286,7 @@ void KDEXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) } } -void KDEXLib::processYield( bool bWait, bool bHandleAllCurrentEvents ) +bool KDEXLib::processYield( bool bWait, bool bHandleAllCurrentEvents ) { QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance( qApp->thread()); bool wasEvent = false; @@ -291,7 +299,8 @@ void KDEXLib::processYield( bool bWait, bool bHandleAllCurrentEvents ) wasEvent = true; } if( bWait && !wasEvent ) - dispatcher->processEvents( QEventLoop::WaitForMoreEvents ); + wasEvent = dispatcher->processEvents( QEventLoop::WaitForMoreEvents ); + return wasEvent; } void KDEXLib::StartTimer( ULONG nMS ) diff --git a/vcl/unx/kde4/KDEXLib.hxx b/vcl/unx/kde4/KDEXLib.hxx index c3f8f27352b5..7bfc542427a9 100644 --- a/vcl/unx/kde4/KDEXLib.hxx +++ b/vcl/unx/kde4/KDEXLib.hxx @@ -69,7 +69,7 @@ class KDEXLib : public QObject, public SalXLib void userEventActivated(); void startTimeoutTimer(); void startUserEventTimer(); - void processYield( bool bWait, bool bHandleAllCurrentEvents ); + bool processYield( bool bWait, bool bHandleAllCurrentEvents ); signals: void startTimeoutTimerSignal(); void startUserEventTimerSignal(); |