[Libreoffice-commits] .: vcl/unx
Lubos Lunak
llunak at kemper.freedesktop.org
Fri Oct 15 05:20:42 PDT 2010
vcl/unx/kde4/KDEXLib.cxx | 13 +++++++++++--
vcl/unx/kde4/KDEXLib.hxx | 2 +-
2 files changed, 12 insertions(+), 3 deletions(-)
New commits:
commit 53d6829b4b3d727a0723129719b3066a1c4c577f
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Fri Oct 15 12:31:41 2010 +0200
try to process Qt events even when not using Qt event loop
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 10d807e..0497848 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 5654f02..ffe93b4 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();
More information about the Libreoffice-commits
mailing list