summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.cpp
diff options
context:
space:
mode:
authorMartin Gräßlin <mgraesslin@kde.org>2013-08-06 15:27:36 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-08 15:09:40 +0200
commitd916ed12b3ce36fce04f107751423f9986be52f0 (patch)
tree3923e189b7e172be018a80a22f284f639bdf9709 /src/plugins/platforms/xcb/qxcbconnection.cpp
parent3ead44fcac856c93a7b56ce7ec032e366d96b989 (diff)
Pass Xcb errors through the native event filter
So far only the xcb plugin is able to handle xcb errors and there is no way for an application to get access to the errors even if the app is using xcb directly. This means Qt is filtering out all xcb errors which are relevant to the app and at the same time the xcb plugin is getting spammed with errors it did not cause and which are logged with a qWarning. By passing the error event through the native event filter an app can filter out all errors it knows to have caused. Change-Id: I158deee2e1c71630f2b1d77174f1091532851b3d Reviewed-by: David Faure (KDE) <faure@kde.org>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 63bc1a6fee..3f717ae2df 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -658,6 +658,11 @@ void QXcbConnection::log(const char *file, int line, int sequence)
void QXcbConnection::handleXcbError(xcb_generic_error_t *error)
{
+ long result = 0;
+ QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance();
+ if (dispatcher && dispatcher->filterNativeEvent(m_nativeInterface->genericEventFilterType(), error, &result))
+ return;
+
uint clamped_error_code = qMin<uint>(error->error_code, (sizeof(xcb_errors) / sizeof(xcb_errors[0])) - 1);
uint clamped_major_code = qMin<uint>(error->major_code, (sizeof(xcb_protocol_request_codes) / sizeof(xcb_protocol_request_codes[0])) - 1);