summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2018-09-19 11:40:31 +0200
committerGatis Paeglis <gatis.paeglis@qt.io>2018-10-16 06:57:01 +0000
commit00ae1e6b7bf6efa5f5e57d37844e44d521604fb6 (patch)
tree7e6c8177f2f9796b30df490f8d582d6668d9f9fa /src/plugins/platforms/xcb/qxcbeventdispatcher.cpp
parentdd8a66daa497f0547f2fcddc0ee1e722d13ab98b (diff)
xcb: respect QEventLoop::ExcludeUserInputEvents in native event handlers
This was a regression from Qt 4. Before this patch, we supported filtering events only at QWindowSystemInterface level, but to properly support filtering in QAbstractEventDispatcher::filterNativeEvent, we have to filter the events earlier. Now it is possible to enable/disable this feature for platforms that support native event filtering. The mapping of which events are user input events were taken from QWindowSystemInterfacePrivate::EventType. Task-number: QTBUG-69687 Change-Id: I9a5fb9f999451c47abcdc83fdcc129b5eeb55447 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbeventdispatcher.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbeventdispatcher.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp b/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp
index 252c1c62e3..3cb2a5b5ef 100644
--- a/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp
+++ b/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp
@@ -58,7 +58,7 @@ QXcbUnixEventDispatcher::~QXcbUnixEventDispatcher()
bool QXcbUnixEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
{
const bool didSendEvents = QEventDispatcherUNIX::processEvents(flags);
- m_connection->processXcbEvents();
+ m_connection->processXcbEvents(flags);
// The following line should not be necessary after QTBUG-70095
return QWindowSystemInterface::sendWindowSystemEvents(flags) || didSendEvents;
}
@@ -99,9 +99,10 @@ static gboolean xcbSourceCheck(GSource *source)
static gboolean xcbSourceDispatch(GSource *source, GSourceFunc, gpointer)
{
auto xcbEventSource = reinterpret_cast<XcbEventSource *>(source);
- xcbEventSource->connection->processXcbEvents();
+ QEventLoop::ProcessEventsFlags flags = xcbEventSource->dispatcher->flags();
+ xcbEventSource->connection->processXcbEvents(flags);
// The following line should not be necessary after QTBUG-70095
- QWindowSystemInterface::sendWindowSystemEvents(xcbEventSource->dispatcher->flags());
+ QWindowSystemInterface::sendWindowSystemEvents(flags);
return true;
}