diff options
author | Gatis Paeglis <gatis.paeglis@qt.io> | 2018-09-18 21:51:57 +0200 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@qt.io> | 2018-10-15 18:33:40 +0000 |
commit | 80b1cce0cfe5d8e527731b921fd5d0c1a007afd5 (patch) | |
tree | 313ae2cf0d5e104843348faf4a7fe8e452a026f8 /src/plugins/platforms/xcb/qxcbintegration.cpp | |
parent | 793a36258dd946d5c2d2a6c10c87c40e88e4736b (diff) |
xcb: call processXcbEvents() on every event loop iteration
It is necessary for QTBUG-69687. The original code processes the xcb
event queue only when new events have arrived, but if we want to do an
event filtering that buffers some events and processes them later based
on set/unset flags (e.g. QEventLoop::ExcludeUserInputEvents), we need
to call processXcbEvents() on every event loop iteration, not only when
new events have arrived from X server.
The required functionality is implemented by having custom event dispatchers,
instead of using the generic ones from QtGenericUnixDispatcher::
createUnixEventDispatcher() / eventdispatcher_support-private. This also
enables for further customizations, as might be necessary by QTBUG-70095.
Task-number: QTBUG-69687
Change-Id: I1f8b2400d26cccf17279d57bb4b678e40c615f33
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbintegration.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbintegration.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index b1a1ed93cd..8f6d35dc5b 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -47,6 +47,7 @@ #include "qxcbnativeinterface.h" #include "qxcbclipboard.h" #include "qxcbeventqueue.h" +#include "qxcbeventdispatcher.h" #if QT_CONFIG(draganddrop) #include "qxcbdrag.h" #endif @@ -58,7 +59,6 @@ #include <xcb/xcb.h> -#include <QtEventDispatcherSupport/private/qgenericunixeventdispatcher_p.h> #include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h> #include <QtServiceSupport/private/qgenericunixservices_p.h> @@ -343,7 +343,7 @@ bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const QAbstractEventDispatcher *QXcbIntegration::createEventDispatcher() const { - QAbstractEventDispatcher *dispatcher = createUnixEventDispatcher(); + QAbstractEventDispatcher *dispatcher = QXcbEventDispatcher::createEventDispatcher(defaultConnection()); for (int i = 0; i < m_connections.size(); i++) m_connections[i]->eventQueue()->registerEventDispatcher(dispatcher); return dispatcher; |