diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp index f5fc2e74c4..75b35f4fb8 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp @@ -66,7 +66,11 @@ bool QXcbEglIntegration::initialize(QXcbConnection *connection) { m_connection = connection; +#ifdef USE_XCB_XLIB Display *dpy = (Display *)m_connection->xlib_display(); +#else + EGLNativeDisplayType dpy = EGL_DEFAULT_DISPLAY; +#endif m_egl_display = eglGetDisplay(dpy); EGLint major, minor; diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 08b414e82e..56b4a9abda 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -1155,10 +1155,12 @@ xcb_window_t QXcbConnection::rootWindow() return primaryScreen()->root(); } +#ifdef XCB_USE_XLIB void *QXcbConnection::xlib_display() const { return m_xlib_display; } +#endif void QXcbConnection::processXcbEvents() { diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 54c32dd3c4..4d14dd14a3 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -328,6 +328,7 @@ void QXcbWindow::create() resolveFormat(); +#ifdef XCB_USE_XLIB if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)) { XVisualInfo *visualInfo = static_cast(createVisual()); if (!visualInfo && window()->surfaceType() == QSurface::OpenGLSurface) @@ -359,6 +360,7 @@ void QXcbWindow::create() XFree(visualInfo); } } +#endif if (!m_window) {