summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-07-12 01:00:11 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2019-07-12 12:23:29 +0200
commit77d126ccb58aba85ab6f363c4314f8481aa0cf1d (patch)
tree1e7f21f001bb1fce6f4af7bb4598b91d519f6355 /src/plugins/platforms/xcb
parent3f8e754f07db944dc74d84cc1c24d3e11677ad09 (diff)
parent786c58817187bb18552934c807ba7a7ea845f49e (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: configure.pri Also required s/solid\.color/solidColor/ in a couple of places in: src/gui/painting/qpaintengine_raster.cpp Change-Id: I29937f63e9779deb6dac7ae77e2948d06ebc0319
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r--src/plugins/platforms/xcb/qxcbeventqueue.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbeventqueue.cpp b/src/plugins/platforms/xcb/qxcbeventqueue.cpp
index 82a36c0727..759ee3cc95 100644
--- a/src/plugins/platforms/xcb/qxcbeventqueue.cpp
+++ b/src/plugins/platforms/xcb/qxcbeventqueue.cpp
@@ -226,11 +226,13 @@ void QXcbEventQueue::run()
};
while (!m_closeConnectionDetected && (event = xcb_wait_for_event(connection))) {
+ m_newEventsMutex.lock();
enqueueEvent(event);
while (!m_closeConnectionDetected && (event = xcb_poll_for_queued_event(connection)))
enqueueEvent(event);
m_newEventsCondition.wakeOne();
+ m_newEventsMutex.unlock();
wakeUpDispatcher();
}
@@ -350,9 +352,12 @@ bool QXcbEventQueue::peekEventQueue(PeekerCallback peeker, void *peekerData,
void QXcbEventQueue::waitForNewEvents(unsigned long time)
{
- m_newEventsMutex.lock();
+ QMutexLocker locker(&m_newEventsMutex);
+ QXcbEventNode *tailBeforeFlush = m_flushedTail;
+ flushBufferedEvents();
+ if (tailBeforeFlush != m_flushedTail)
+ return;
m_newEventsCondition.wait(&m_newEventsMutex, time);
- m_newEventsMutex.unlock();
}
void QXcbEventQueue::sendCloseConnectionEvent() const