[Libreoffice-commits] core.git: vcl/unx
Michael Stahl
mstahl at redhat.com
Tue Nov 17 02:06:00 PST 2015
vcl/unx/kde4/KDESalDisplay.cxx | 9 +++++----
vcl/unx/kde4/KDESalDisplay.hxx | 2 +-
vcl/unx/kde4/KDEXLib.cxx | 15 ++++++++++-----
vcl/unx/kde4/KDEXLib.hxx | 4 ++--
4 files changed, 18 insertions(+), 12 deletions(-)
New commits:
commit 472c81fa62b7cc27a583beb99e6cbc70ab0de733
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Nov 17 11:03:02 2015 +0100
vcl: fix the kde4 build
... after eca4c54e52363f80db26e228e586aeb7732c7100 - not sure if it's
correct but at least it builds for me.
Change-Id: I36083fac98c830560cdc799923d309f96e8cdd6d
diff --git a/vcl/unx/kde4/KDESalDisplay.cxx b/vcl/unx/kde4/KDESalDisplay.cxx
index 105393f..33a36e4 100644
--- a/vcl/unx/kde4/KDESalDisplay.cxx
+++ b/vcl/unx/kde4/KDESalDisplay.cxx
@@ -46,14 +46,14 @@ SalKDEDisplay::~SalKDEDisplay()
pDisp_ = nullptr;
}
-void SalKDEDisplay::Yield()
+bool SalKDEDisplay::Yield()
{
if( DispatchInternalEvent() )
- return;
+ return true;
// Prevent blocking from Drag'n'Drop events, which may have already have processed the event
if (XEventsQueued( pDisp_, QueuedAfterReading ) == 0)
- return;
+ return false;
DBG_ASSERT( static_cast<SalYieldMutex*>(GetSalData()->m_pInstance->GetYieldMutex())->GetThreadId() ==
osl::Thread::getCurrentIdentifier(),
@@ -62,8 +62,9 @@ void SalKDEDisplay::Yield()
XEvent event;
XNextEvent( pDisp_, &event );
if( checkDirectInputEvent( &event ))
- return;
+ return true;
qApp->x11ProcessEvent( &event );
+ return true;
}
// HACK: When using Qt event loop, input methods (japanese, etc.) will get broken because
diff --git a/vcl/unx/kde4/KDESalDisplay.hxx b/vcl/unx/kde4/KDESalDisplay.hxx
index a262a6a..59734c7 100644
--- a/vcl/unx/kde4/KDESalDisplay.hxx
+++ b/vcl/unx/kde4/KDESalDisplay.hxx
@@ -27,7 +27,7 @@ class SalKDEDisplay : public SalX11Display
explicit SalKDEDisplay( Display* pDisp );
virtual ~SalKDEDisplay();
static SalKDEDisplay* self();
- virtual void Yield() override;
+ virtual bool Yield() override;
bool checkDirectInputEvent( XEvent* ev );
private:
Atom xim_protocol;
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 6c3023b..653ce40 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -278,22 +278,25 @@ void KDEXLib::socketNotifierActivated( int fd )
sdata.handle( fd, sdata.data );
}
-void KDEXLib::Yield( bool bWait, bool bHandleAllCurrentEvents )
+bool KDEXLib::Yield( bool bWait, bool bHandleAllCurrentEvents )
{
if( !m_isGlibEventLoopType )
{
+ bool wasEvent = false;
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 );
+ wasEvent = processYield( false, bHandleAllCurrentEvents );
}
- return SalXLib::Yield( bWait, bHandleAllCurrentEvents );
+ return SalXLib::Yield(bWait, bHandleAllCurrentEvents) || wasEvent;
}
// if we are the main thread (which is where the event processing is done),
// good, just do it
if( qApp->thread() == QThread::currentThread())
- processYield( bWait, bHandleAllCurrentEvents );
+ {
+ return processYield( bWait, bHandleAllCurrentEvents );
+ }
else
{
// we were called from another thread;
@@ -302,10 +305,11 @@ void KDEXLib::Yield( bool bWait, bool bHandleAllCurrentEvents )
// temporarily do it while checking for new events)
SalYieldMutexReleaser aReleaser;
Q_EMIT processYieldSignal( bWait, bHandleAllCurrentEvents );
+ return false;
}
}
-void KDEXLib::processYield( bool bWait, bool bHandleAllCurrentEvents )
+bool KDEXLib::processYield( bool bWait, bool bHandleAllCurrentEvents )
{
blockIdleTimeout = !bWait;
QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance( qApp->thread());
@@ -321,6 +325,7 @@ void KDEXLib::processYield( bool bWait, bool bHandleAllCurrentEvents )
if( bWait && !wasEvent )
dispatcher->processEvents( QEventLoop::WaitForMoreEvents );
blockIdleTimeout = false;
+ return wasEvent;
}
void KDEXLib::StartTimer( sal_uLong nMS )
diff --git a/vcl/unx/kde4/KDEXLib.hxx b/vcl/unx/kde4/KDEXLib.hxx
index 951acb9..4593298 100644
--- a/vcl/unx/kde4/KDEXLib.hxx
+++ b/vcl/unx/kde4/KDEXLib.hxx
@@ -67,7 +67,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 );
Q_SIGNALS:
void startTimeoutTimerSignal();
void startUserEventTimerSignal();
@@ -82,7 +82,7 @@ class KDEXLib : public QObject, public SalXLib
virtual ~KDEXLib();
virtual void Init() override;
- virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) override;
+ virtual bool Yield( bool bWait, bool bHandleAllCurrentEvents ) override;
virtual void Insert( int fd, void* data, YieldFunc pending, YieldFunc queued, YieldFunc handle ) override;
virtual void Remove( int fd ) override;
virtual void StartTimer( sal_uLong nMS ) override;
More information about the Libreoffice-commits
mailing list