From 6c7374f071d998f726cd4a5b67baf54e357d096b Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Fri, 14 Mar 2014 21:02:16 +0100 Subject: 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 --- vcl/unx/kde4/KDESalDisplay.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vcl/unx') 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(GetSalData()->m_pInstance->GetYieldMutex())->GetThreadId() == osl::Thread::getCurrentIdentifier(), "will crash soon since solar mutex not locked in SalKDEDisplay::Yield" ); -- cgit