diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-03-30 10:29:27 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-03-30 10:31:32 (GMT) |
commit | b35988fe3299b2f76fb29507ca46298c2bef47df (patch) | |
tree | ac67a338bef6a08a7fa46040f21472d791b57e39 /src/plugins/platforms/xcb/qxcbconnection.h | |
parent | c25609217e99f890431c0170fea585b3e86822ad (diff) | |
download | Qt-b35988fe3299b2f76fb29507ca46298c2bef47df.zip Qt-b35988fe3299b2f76fb29507ca46298c2bef47df.tar.gz Qt-b35988fe3299b2f76fb29507ca46298c2bef47df.tar.bz2 |
Added X error tracking to XCB platform.
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.h')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.h | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index a36694d..0a7efd5 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -1,5 +1,4 @@ -/**************************************************************************** -** +/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) @@ -46,8 +45,11 @@ #include <QList> #include <QMutex> +#include <QVector> #include <QThread> +#define Q_XCB_DEBUG + class QXcbScreen; namespace QXcbAtom { @@ -295,10 +297,36 @@ private: void *m_egl_display; bool m_has_egl; #endif +#ifdef Q_XCB_DEBUG + struct CallInfo { + int sequence; + QByteArray file; + int line; + }; + QVector<CallInfo> m_callLog; + void log(const char *file, int line, int sequence); + template <typename cookie_t> + friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); +#endif }; #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) +#ifdef Q_XCB_DEBUG +template <typename cookie_t> +cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) +{ + connection->log(file, line, cookie.sequence); + return cookie; +} +#define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) +#define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) +#else +#define Q_XCB_CALL(x) x +#define Q_XCB_CALL2(x, connection) x +#endif + + #if defined(XCB_USE_DRI2) || defined(XCB_USE_EGL) #define EGL_DISPLAY_FROM_XCB(object) ((EGLDisplay)(object->connection()->egl_display())) #endif //endifXCB_USE_DRI2 |