summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2014-03-10 14:44:05 +0000
committerJan-Marek Glogowski <glogow@fbihome.de>2014-03-10 15:26:07 +0000
commitaeda478a02523cec146f6af69710f0391061db56 (patch)
treef5804450824c2d98b3a3306cac128d9ba98ef0f0 /vcl/unx
parentd4cc603a5f80af746a5f381f28cfa049af5b314a (diff)
fdo#73115: Always run timeouts as events
Right-click popup menus run click events throught the LO main loop. In case of KDE4 the LO main loop is run by a timer in the main thread, with Qt::DirectConnection execution. If the timeout actually starts a nested event loop for a new dialog, the timer is blocked, the nested mainloop detects it was started from the timeout and drops the blocked timout from polling, which blocks any further LibreOffice event loop processing. This changes the timers to Qt::QueuedConnection, so they always generate an event and are processed by the Qt event loop. Change-Id: Ie626b22be3d8f9b8934bcc5e9e0e67a365549cfc
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/kde4/KDEXLib.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index d914caaddf96..29797a144db3 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -61,9 +61,13 @@ KDEXLib::KDEXLib() :
eventLoopType( LibreOfficeEventLoop ),
m_bYieldFrozen( false ), m_frameWidth( -1 )
{
- // the timers created here means they belong to the main thread
- connect( &timeoutTimer, SIGNAL( timeout()), this, SLOT( timeoutActivated()));
- connect( &userEventTimer, SIGNAL( timeout()), this, SLOT( userEventActivated()));
+ // the timers created here means they belong to the main thread.
+ // As the timeoutTimer runs the LO event queue, which may block on a dialog,
+ // the timer has to use a Qt::QueuedConnection, otherwise the nested event
+ // loop will detect the blocking timer and drop it from the polling
+ // freezing LO X11 processing.
+ connect( &timeoutTimer, SIGNAL( timeout()), this, SLOT( timeoutActivated()), Qt::QueuedConnection );
+ connect( &userEventTimer, SIGNAL( timeout()), this, SLOT( userEventActivated()), Qt::QueuedConnection );
// QTimer::start() can be called only in its (here main) thread, so this will
// forward between threads if needed