From b2035d38e8dfdfe2ba8da96df5c1174f01dfbb5b Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Tue, 20 Mar 2018 17:21:58 +0100 Subject: xcb: minor cleanups around QT_CONFIG(xcb_xlib) - Remove unused createVisualInfoForDefaultVisualId() function. This amends dff3c0f14f3c3a7288c456028d5bec23bee5406a. - Inline QXcbConnection::xlib_display(). - Don't nest QT_CONFIG(xcb_native_painting) in QT_CONFIG(xcb_xlib). configure.json already checks for the dependencies, we don't need to do that again in *.h/*.cpp. Change-Id: If39912e67ce9baa31faf091bebe120bac5cf6876 Reviewed-by: Alexander Volkov Reviewed-by: Gatis Paeglis --- src/plugins/platforms/xcb/qxcbconnection.cpp | 23 ----------------------- src/plugins/platforms/xcb/qxcbconnection.h | 3 +-- src/plugins/platforms/xcb/qxcbintegration.cpp | 2 +- 3 files changed, 2 insertions(+), 26 deletions(-) (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index ac0aade958..94dbb76117 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -1610,29 +1610,6 @@ xcb_window_t QXcbConnection::clientLeader() return m_clientLeader; } -#if QT_CONFIG(xcb_xlib) -void *QXcbConnection::xlib_display() const -{ - return m_xlib_display; -} - -void *QXcbConnection::createVisualInfoForDefaultVisualId() const -{ - if (m_defaultVisualId == UINT_MAX) - return 0; - XVisualInfo info; - memset(&info, 0, sizeof info); - info.visualid = m_defaultVisualId; - - int count = 0; - Display *dpy = static_cast(connection()->xlib_display()); - XVisualInfo *retVisual = XGetVisualInfo(dpy, VisualIDMask, &info, &count); - Q_ASSERT(count < 2); - return retVisual; -} - -#endif - #if QT_CONFIG(xcb_xinput) static inline bool isXIType(xcb_generic_event_t *event, int opCode, uint16_t type) { diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index c8b5c5095c..9e16d15b20 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -423,8 +423,7 @@ public: xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #if QT_CONFIG(xcb_xlib) - void *xlib_display() const; - void *createVisualInfoForDefaultVisualId() const; + void *xlib_display() const { return m_xlib_display; } #endif void sync(); diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 471287eb44..143ea799b0 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -65,12 +65,12 @@ #if QT_CONFIG(xcb_xlib) #include +#endif #if QT_CONFIG(xcb_native_painting) #include "qxcbnativepainting.h" #include "qpixmap_x11_p.h" #include "qbackingstore_x11_p.h" #endif -#endif #include #include -- cgit v1.2.3