From 05eff54d668a70d211557ca491f8785f16cfce72 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Mon, 19 Apr 2021 20:17:52 +0200 Subject: [PATCH] Fix build when xcb_glx_plugin config is disabled After 7266bd459e7cf8d4f4e3ad67b4ff23dea4fbfd0e QGLXIntegration and QGLXContext are not defined if xcb_glx_plugin is disabled. That will happen e.g. when gles is requested instead of desktop GL. Protect the usage of those symbols in the xcb plugin accordingly. Change-Id: I4bea60787fd3175450de05a8e522ef9c8b438ee7 Reviewed-by: Laszlo Agocs --- src/plugins/platforms/xcb/qxcbintegration.cpp | 2 ++ src/plugins/platforms/xcb/qxcbintegration.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 89395cb21d..2dd2bcf11f 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -274,6 +274,7 @@ QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLCont return glIntegration->createPlatformOpenGLContext(context); } +# if QT_CONFIG(xcb_glx_plugin) QOpenGLContext *QXcbIntegration::createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const { using namespace QNativeInterface::Private; @@ -282,6 +283,7 @@ QOpenGLContext *QXcbIntegration::createOpenGLContext(GLXContext context, void *v else return nullptr; } +# endif #if QT_CONFIG(egl) QOpenGLContext *QXcbIntegration::createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const diff --git a/src/plugins/platforms/xcb/qxcbintegration.h b/src/plugins/platforms/xcb/qxcbintegration.h index eb58433967..e37ca41e0e 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.h +++ b/src/plugins/platforms/xcb/qxcbintegration.h @@ -57,7 +57,9 @@ class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration #ifndef QT_NO_OPENGL +# if QT_CONFIG(xcb_glx_plugin) , public QNativeInterface::Private::QGLXIntegration +# endif # if QT_CONFIG(egl) , public QNativeInterface::Private::QEGLIntegration # endif @@ -72,7 +74,9 @@ public: QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; +# if QT_CONFIG(xcb_glx_plugin) QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override; +# endif # if QT_CONFIG(egl) QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override; # endif