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 <a.volkov@rusbitech.ru>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This commit is contained in:
Gatis Paeglis 2018-03-20 17:21:58 +01:00
parent ead3ca4aef
commit b2035d38e8
3 changed files with 2 additions and 26 deletions

View File

@ -1610,29 +1610,6 @@ xcb_window_t QXcbConnection::clientLeader()
return m_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<Display *>(connection()->xlib_display());
XVisualInfo *retVisual = XGetVisualInfo(dpy, VisualIDMask, &info, &count);
Q_ASSERT(count < 2);
return retVisual;
}
#endif
#if QT_CONFIG(xcb_xinput) #if QT_CONFIG(xcb_xinput)
static inline bool isXIType(xcb_generic_event_t *event, int opCode, uint16_t type) static inline bool isXIType(xcb_generic_event_t *event, int opCode, uint16_t type)
{ {

View File

@ -423,8 +423,7 @@ public:
xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; }
#if QT_CONFIG(xcb_xlib) #if QT_CONFIG(xcb_xlib)
void *xlib_display() const; void *xlib_display() const { return m_xlib_display; }
void *createVisualInfoForDefaultVisualId() const;
#endif #endif
void sync(); void sync();

View File

@ -65,12 +65,12 @@
#if QT_CONFIG(xcb_xlib) #if QT_CONFIG(xcb_xlib)
#include <X11/Xlib.h> #include <X11/Xlib.h>
#endif
#if QT_CONFIG(xcb_native_painting) #if QT_CONFIG(xcb_native_painting)
#include "qxcbnativepainting.h" #include "qxcbnativepainting.h"
#include "qpixmap_x11_p.h" #include "qpixmap_x11_p.h"
#include "qbackingstore_x11_p.h" #include "qbackingstore_x11_p.h"
#endif #endif
#endif
#include <qpa/qplatforminputcontextfactory_p.h> #include <qpa/qplatforminputcontextfactory_p.h>
#include <private/qgenericunixthemes_p.h> #include <private/qgenericunixthemes_p.h>