From d55e3bdced8efa69287c968a34fa37148a853f45 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Thu, 23 Feb 2017 16:44:22 +0100 Subject: xcb: remove code and macros related to Q_XCB_DEBUG ... early spring-cleaning, leaving one block of virtual root debug code that was inappropriately conditioned on Q_XCB_DEBUG; it now gets its own define. Removed Q_XCB_CALL: 1) I don't know anyone who actually uses it. 2) Enabling this feature (via Q_XCB_DEBUG) fails to build (and has been like that for about 1 year). 3) There are better ways to debug X11 client message exchange (see xtrace for example). 4) Using Q_XCB_CALL is a very fragile approach. Grep for example for xcb_change_property and you will see that half of the calls are not wrapped with the Q_XCB_CALL macro. This patch also removes the Q_XCB_NOOP macro. It's unclear what its purpose was. There was a TODO comment in qxcbeglcontext.h suggesting removal of this macro as well. Its evaluation of its parameter, even without Q_XCB_DEBUG, had no side-effects, so its removal should be harmless. Change-Id: I9fa48af454061d8b38f69f308131647cd18f85f4 Reviewed-by: Edward Welbourne Reviewed-by: Alexander Volkov Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbconnection.h | 43 ------------------------------ 1 file changed, 43 deletions(-) (limited to 'src/plugins/platforms/xcb/qxcbconnection.h') diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index c298c08322..fa4fd68686 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -83,8 +83,6 @@ struct XInput2TouchDeviceData; struct xcb_randr_get_output_info_reply_t; -//#define Q_XCB_DEBUG - QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) @@ -649,23 +647,6 @@ private: } m_startSystemResizeInfo; #endif #endif -#ifdef Q_XCB_DEBUG - struct CallInfo { - int sequence; - QByteArray file; - int line; - }; - QVector m_callLog; - QMutex m_callLogMutex; - void log(const char *file, int line, int sequence); - template - friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, - const char *file, int line); - template - friend reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, - const char *file, int line); -#endif - WindowMapper m_mapper; QVector m_peekFuncs; @@ -747,30 +728,6 @@ private: std::free \ ) -#ifdef Q_XCB_DEBUG -template -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; -} - -template -reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line) -{ - connection->log(file, line, reply->sequence); - return reply; -} -#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__) -#define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); -#else -#define Q_XCB_CALL(x) x -#define Q_XCB_CALL2(x, connection) x -#define Q_XCB_NOOP(c) (void)c; -#endif - QT_END_NAMESPACE #endif -- cgit v1.2.3