From b1381ea9ebb3dd4019081f4412f82a3280b4eb52 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Wed, 22 Feb 2017 13:55:28 +0300 Subject: xcb: Use QT_CONFIG macro to check for xcb-xlib ... and remove the XCB_USE_XLIB define. This patch also removes the unnecessary checks for xcb-xlib in: - qxcbglxintegration.cpp as this files is build _only_ when xcb-xlib is present. From gl_integrations.pro: qtConfig(xcb-xlib):qtConfig(opengl):!qtConfig(opengles2) { SUBDIRS += xcb_glx } This also would have been the right place where to define XCB_USE_XLIB, instead of unconditional line in xcb_glx.pro: DEFINES += XCB_USE_GLX XCB_USE_XLIB - qxcbnativeinterface.cpp as this cpp file does not use any Xlib APIs directly, there is no need to include Xlib.h. Change-Id: I531b5f1e79606fcfd1c63810cf51b7d5e9dc58a7 Reviewed-by: Gatis Paeglis --- src/plugins/platforms/xcb/qxcbcursor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/plugins/platforms/xcb/qxcbcursor.cpp') diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp index d257ab1242..7c62c2e2b3 100644 --- a/src/plugins/platforms/xcb/qxcbcursor.cpp +++ b/src/plugins/platforms/xcb/qxcbcursor.cpp @@ -60,7 +60,7 @@ typedef char *(*PtrXcursorLibraryGetTheme)(void *); typedef int (*PtrXcursorLibrarySetTheme)(void *, const char *); typedef int (*PtrXcursorLibraryGetDefaultSize)(void *); -#if defined(XCB_USE_XLIB) && QT_CONFIG(library) +#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) #include enum { XCursorShape = CursorShape @@ -308,7 +308,7 @@ QXcbCursor::QXcbCursor(QXcbConnection *conn, QXcbScreen *screen) const char *cursorStr = "cursor"; xcb_open_font(xcb_connection(), cursorFont, strlen(cursorStr), cursorStr); -#if defined(XCB_USE_XLIB) && QT_CONFIG(library) +#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static bool function_ptrs_not_initialized = true; if (function_ptrs_not_initialized) { QLibrary xcursorLib(QLatin1String("Xcursor"), 1); @@ -509,7 +509,7 @@ xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape) return cursor; } -#if defined(XCB_USE_XLIB) && QT_CONFIG(library) +#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) bool updateCursorTheme(void *dpy, const QByteArray &theme) { if (!ptrXcursorLibraryGetTheme || !ptrXcursorLibrarySetTheme) @@ -553,7 +553,7 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape) } return cursor; } -#endif // XCB_USE_XLIB / QT_CONFIG(library) +#endif // QT_CONFIG(xcb_xlib) / QT_CONFIG(library) xcb_cursor_t QXcbCursor::createFontCursor(int cshape) { @@ -562,7 +562,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) xcb_cursor_t cursor = XCB_NONE; // Try Xcursor first -#if defined(XCB_USE_XLIB) && QT_CONFIG(library) +#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) if (cshape >= 0 && cshape <= Qt::LastCursor) { void *dpy = connection()->xlib_display(); // special case for non-standard dnd-* cursors -- cgit v1.2.3