diff --git a/autotests/libkwineffects/kwinglplatformtest.cpp b/autotests/libkwineffects/kwinglplatformtest.cpp index 2c5764b23d..50078ad387 100644 --- a/autotests/libkwineffects/kwinglplatformtest.cpp +++ b/autotests/libkwineffects/kwinglplatformtest.cpp @@ -155,7 +155,6 @@ void GLPlatformTest::testPriorDetect() QCOMPARE(gl->glslVersion(), Version()); QCOMPARE(gl->mesaVersion(), Version()); QCOMPARE(gl->galliumVersion(), Version()); - QCOMPARE(gl->serverVersion(), Version()); QCOMPARE(gl->driverVersion(), Version()); QCOMPARE(gl->driver(), Driver_Unknown); @@ -255,7 +254,6 @@ void GLPlatformTest::testDetect() QCOMPARE(gl->glslVersion(), readVersion(settingsGroup, "GLSLVersion")); QCOMPARE(gl->mesaVersion(), readVersion(settingsGroup, "MesaVersion")); QCOMPARE(gl->galliumVersion(), readVersion(settingsGroup, "GalliumVersion")); - QCOMPARE(gl->serverVersion(), Version()); QEXPECT_FAIL("amd-catalyst-radeonhd-7700M-3.1.13399", "Detects GL version instead of driver version", Continue); QCOMPARE(gl->driverVersion(), readVersion(settingsGroup, "DriverVersion")); diff --git a/src/libkwineffects/glplatform.cpp b/src/libkwineffects/glplatform.cpp index 61c4d1a3ef..730d1e7770 100644 --- a/src/libkwineffects/glplatform.cpp +++ b/src/libkwineffects/glplatform.cpp @@ -30,19 +30,6 @@ namespace KWin std::unique_ptr GLPlatform::s_platform; -static Version getXServerVersion() -{ - if (xcb_connection_t *c = connection()) { - auto setup = xcb_get_setup(c); - const QByteArray vendorName(xcb_setup_vendor(setup), xcb_setup_vendor_length(setup)); - if (vendorName.contains("X.Org")) { - const int release = setup->release_number; - return Version(release / 10000000, (release / 100000) % 100, (release / 1000) % 100); - } - } - return Version(0, 0, 0); -} - // Extracts the portion of a string that matches a regular expression static QString extract(const QString &text, const QString &pattern) { @@ -791,8 +778,6 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) } } - m_serverVersion = getXServerVersion(); - if (m_supportsGLSL) { // Parse the GLSL version m_glsl_version = (const char *)glGetString(GL_SHADING_LANGUAGE_VERSION); @@ -1158,9 +1143,6 @@ void GLPlatform::printResults() const } // if (galliumVersion() > 0) // print("Gallium version:", versionToString(m_galliumVersion)); - if (serverVersion().isValid()) { - print(QByteArrayLiteral("X server version:"), m_serverVersion.toByteArray()); - } print(QByteArrayLiteral("Requires strict binding:"), !m_looseBinding ? QByteArrayLiteral("yes") : QByteArrayLiteral("no")); print(QByteArrayLiteral("GLSL shaders:"), m_supportsGLSL ? QByteArrayLiteral("yes") : QByteArrayLiteral("no")); @@ -1208,11 +1190,6 @@ Version GLPlatform::galliumVersion() const return m_galliumVersion; } -Version GLPlatform::serverVersion() const -{ - return m_serverVersion; -} - Version GLPlatform::driverVersion() const { if (isMesaDriver()) { diff --git a/src/libkwineffects/glplatform.h b/src/libkwineffects/glplatform.h index 0b30ab8404..bc388b41ce 100644 --- a/src/libkwineffects/glplatform.h +++ b/src/libkwineffects/glplatform.h @@ -226,16 +226,6 @@ public: */ Version galliumVersion() const; - /** - * Returns the X server version. - * - * Note that the version number changed from 7.2 to 1.3 in the first release - * following the doupling of the X server from the katamari. - * - * For non X.org servers, this method returns 0. - */ - Version serverVersion() const; - /** * Returns the driver version. * @@ -431,7 +421,6 @@ private: Version m_mesaVersion; Version m_driverVersion; Version m_galliumVersion; - Version m_serverVersion; bool m_looseBinding : 1; bool m_supportsGLSL : 1; bool m_textureNPOT : 1; diff --git a/src/utils/xcbutils.h b/src/utils/xcbutils.h index 1589d0cb2f..61fa72ae9a 100644 --- a/src/utils/xcbutils.h +++ b/src/utils/xcbutils.h @@ -10,6 +10,7 @@ #include "libkwineffects/kwinglobals.h" #include "libkwineffects/kwinxcb.h" +#include "libkwineffects/version.h" #include "main.h" #include "utils/c_ptr.h" @@ -2079,6 +2080,19 @@ inline uint8_t Shm::pixmapFormat() const return m_pixmapFormat; } +inline static Version xServerVersion() +{ + if (xcb_connection_t *c = connection()) { + auto setup = xcb_get_setup(c); + const QByteArray vendorName(xcb_setup_vendor(setup), xcb_setup_vendor_length(setup)); + if (vendorName.contains("X.Org")) { + const int release = setup->release_number; + return Version(release / 10000000, (release / 100000) % 100, (release / 1000) % 100); + } + } + return Version(0, 0, 0); +} + } // namespace X11 } // namespace KWin diff --git a/src/workspace.cpp b/src/workspace.cpp index 1749cbb1bf..30b7b3598f 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -1796,8 +1796,8 @@ QString Workspace::supportInformation() const if (platform->isMesaDriver()) { support.append(QStringLiteral("Mesa version: ") + platform->mesaVersion().toString() + QStringLiteral("\n")); } - if (platform->serverVersion().isValid()) { - support.append(QStringLiteral("X server version: ") + platform->serverVersion().toString() + QStringLiteral("\n")); + if (auto xVersion = Xcb::xServerVersion(); xVersion.isValid()) { + support.append(QStringLiteral("X server version: ") + xVersion.toString() + QStringLiteral("\n")); } if (auto kernelVersion = linuxKernelVersion(); kernelVersion.isValid()) { support.append(QStringLiteral("Linux kernel version: ") + kernelVersion.toString() + QStringLiteral("\n"));