summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2014-03-14 21:02:16 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-03-22 15:14:17 +0000
commit448cd2be26527dc55b13d89c53c723ff62c32e95 (patch)
tree6fabbd12d9368712a7c9b66bccd20ff24ccde82b
parent6df01ea56717803f1ccf66bbbbb7a2815aa09fb5 (diff)
fdo#67011 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. (cherry picked from commit 6c7374f071d998f726cd4a5b67baf54e357d096b) Change-Id: Ifb0631b38abc0ddab23cd74aad05120b4b3dacad Reviewed-on: https://gerrit.libreoffice.org/8710 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/unx/kde4/KDESalDisplay.cxx4
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" );