summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2014-03-14 21:02:16 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2014-03-14 23:44:13 +0100
commit6c7374f071d998f726cd4a5b67baf54e357d096b (patch)
tree32c472c7f5966c349ea6fbb869fa0fa26673d10b /vcl/unx
parentcc8d566d74a2e0b969b92d9cf22cc95a3bf31a98 (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
Diffstat (limited to 'vcl/unx')
-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" );