diff --git a/libkwineffects/kwinglutils.cpp b/libkwineffects/kwinglutils.cpp index 029bcf813c..584aadb761 100644 --- a/libkwineffects/kwinglutils.cpp +++ b/libkwineffects/kwinglutils.cpp @@ -64,8 +64,6 @@ along with this program. If not, see . namespace KWin { // Variables -// GLX version, use MAKE_GL_VERSION() macro for comparing with a specific version -static int glXVersion; // EGL version, use MAKE_GL_VERSION() macro for comparing with a specific version static int eglVersion; // List of all supported GL, EGL and GLX extensions @@ -80,10 +78,6 @@ int glTextureUnitsCount; void initGLX() { #if HAVE_EPOXY_GLX - // Get GLX version - int major, minor; - glXQueryVersion(display(), &major, &minor); - glXVersion = MAKE_GL_VERSION(major, minor, 0); // Get list of supported GLX extensions const QByteArray string = (const char *) glXQueryExtensionsString(display(), QX11Info::appScreen()); s_glxExtensions = string.split(' '); @@ -138,7 +132,6 @@ void cleanupGL() s_glxExtensions.clear(); s_eglExtensions.clear(); - glXVersion = 0; eglVersion = 0; glTextureUnitsCount = 0; } @@ -148,11 +141,6 @@ bool hasGLVersion(int major, int minor, int release) return GLPlatform::instance()->glVersion() >= kVersionNumber(major, minor, release); } -bool hasGLXVersion(int major, int minor, int release) -{ - return glXVersion >= MAKE_GL_VERSION(major, minor, release); -} - bool hasEGLVersion(int major, int minor, int release) { return eglVersion >= MAKE_GL_VERSION(major, minor, release); diff --git a/libkwineffects/kwinglutils.h b/libkwineffects/kwinglutils.h index 8226380f66..e8e236784c 100644 --- a/libkwineffects/kwinglutils.h +++ b/libkwineffects/kwinglutils.h @@ -65,7 +65,6 @@ extern KWINGLUTILS_EXPORT int glTextureUnitsCount; bool KWINGLUTILS_EXPORT hasGLVersion(int major, int minor, int release = 0); -bool KWINGLUTILS_EXPORT hasGLXVersion(int major, int minor, int release = 0); bool KWINGLUTILS_EXPORT hasEGLVersion(int major, int minor, int release = 0); // use for both OpenGL and GLX extensions bool KWINGLUTILS_EXPORT hasGLExtension(const QByteArray &extension); diff --git a/plugins/platforms/x11/standalone/glxbackend.cpp b/plugins/platforms/x11/standalone/glxbackend.cpp index abe6f83870..1acbecfe64 100644 --- a/plugins/platforms/x11/standalone/glxbackend.cpp +++ b/plugins/platforms/x11/standalone/glxbackend.cpp @@ -153,7 +153,7 @@ void GlxBackend::init() initGLX(); // Require at least GLX 1.3 - if (!hasGLXVersion(1, 3)) { + if (!checkVersion()) { setFailed(QStringLiteral("Requires at least GLX 1.3")); return; } @@ -246,6 +246,13 @@ void GlxBackend::init() qCDebug(KWIN_X11STANDALONE) << "Direct rendering:" << isDirectRendering(); } +bool GlxBackend::checkVersion() +{ + int major, minor; + glXQueryVersion(display(), &major, &minor); + return kVersionNumber(major, minor) >= kVersionNumber(1, 3); +} + bool GlxBackend::initRenderingContext() { const bool direct = true; diff --git a/plugins/platforms/x11/standalone/glxbackend.h b/plugins/platforms/x11/standalone/glxbackend.h index 77a4a7f830..d31a1b67ee 100644 --- a/plugins/platforms/x11/standalone/glxbackend.h +++ b/plugins/platforms/x11/standalone/glxbackend.h @@ -78,6 +78,7 @@ protected: private: bool initBuffer(); + bool checkVersion(); void waitSync(); bool initRenderingContext(); bool initFbConfig();