diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2014-03-14 21:02:16 +0100 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2014-08-20 09:44:45 +0200 |
commit | 56923b68beeecb06e79e517997cba1d57145ebf4 (patch) | |
tree | 1b11428e217f0459548b41bf6fca8cec3fe7a9b3 | |
parent | 964cf9fe635efee42cbf1c5f57dc2d5fb23342b8 (diff) |
KDE4: prevent blocking in Display::Yield
SalX11Display registers a Yield handler, which splits check and
and processing into two functions, which both lock the yield mutex.
Normally this no problem, but during a Drag'n'Drop operation the
D'n'D thread also checks and processes XEvents (for D'n'D). So the
XNextEvent in Display::Yield will actually block, if the seen XEvent
was for D'n'D and was already processed.
Change-Id: I9f8d96d4f9986997cbe150a2b66bc767b4bbc2f1
(cherry picked from commit 6c7374f071d998f726cd4a5b67baf54e357d096b)
-rw-r--r-- | vcl/unx/kde4/KDESalDisplay.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/unx/kde4/KDESalDisplay.cxx b/vcl/unx/kde4/KDESalDisplay.cxx index 21440fc4d7d4..650b2662005d 100644 --- a/vcl/unx/kde4/KDESalDisplay.cxx +++ b/vcl/unx/kde4/KDESalDisplay.cxx @@ -51,6 +51,10 @@ void SalKDEDisplay::Yield() if( DispatchInternalEvent() ) return; + // Prevent blocking from Drag'n'Drop events, which may have already have processed the event + if (XEventsQueued( pDisp_, QueuedAfterReading ) == 0) + return; + DBG_ASSERT( static_cast<SalYieldMutex*>(GetSalData()->m_pInstance->GetYieldMutex())->GetThreadId() == osl::Thread::getCurrentIdentifier(), "will crash soon since solar mutex not locked in SalKDEDisplay::Yield" ); |