Extend GLX switch to check if QtGui was being built with GLX plugin

Even though epoxy with GLX may be present, Qt's native interface only
exposes GLX API when it was being built with GLX support.
master
Andreas Cord-Landwehr 1 year ago
parent d80120fe7e
commit 258e9d8426

@ -367,7 +367,12 @@ option(KWIN_BUILD_TABBOX "Enable building of KWin Tabbox functionality" ON)
cmake_dependent_option(KWIN_BUILD_ACTIVITIES "Enable building of KWin with kactivities support" ON "KF6Activities_FOUND" OFF)
cmake_dependent_option(KWIN_BUILD_RUNNERS "Enable building of KWin with krunner support" ON "KF6Runner_FOUND" OFF)
set(HAVE_EPOXY_GLX ${epoxy_HAS_GLX})
set(HAVE_GLX ${epoxy_HAS_GLX})
get_target_property(QT_DISABLED_FEATURES Qt6::Gui QT_DISABLED_PUBLIC_FEATURES)
if("xcb_glx_plugin" IN_LIST QT_DISABLED_FEATURES)
message(STATUS "Disable GLX because Qt6::Gui was built without xcb_glx_plugin")
set(HAVE_GLX false)
endif()
# for kwin internal things
set(HAVE_X11_XCB ${X11_XCB_FOUND})

@ -180,7 +180,7 @@ set(testOpenGLContextAttributeBuilder_SRCS
opengl_context_attribute_builder_test.cpp
)
if (HAVE_EPOXY_GLX)
if (HAVE_GLX)
set(testOpenGLContextAttributeBuilder_SRCS ${testOpenGLContextAttributeBuilder_SRCS} ../src/backends/x11/standalone/x11_standalone_glx_context_attribute_builder.cpp)
endif()
add_executable(testOpenGLContextAttributeBuilder ${testOpenGLContextAttributeBuilder_SRCS})

@ -12,7 +12,7 @@
#include <epoxy/egl.h>
#include "libkwineffects/kwinconfig.h"
#if HAVE_EPOXY_GLX
#if HAVE_GLX
#include "../src/backends/x11/standalone/x11_standalone_glx_context_attribute_builder.h"
#include <epoxy/glx.h>
@ -387,7 +387,7 @@ void OpenGLContextAttributeBuilderTest::testGles()
void OpenGLContextAttributeBuilderTest::testGlx_data()
{
#if HAVE_EPOXY_GLX
#if HAVE_GLX
QTest::addColumn<bool>("requestVersion");
QTest::addColumn<int>("major");
QTest::addColumn<int>("minor");
@ -442,7 +442,7 @@ void OpenGLContextAttributeBuilderTest::testGlx_data()
void OpenGLContextAttributeBuilderTest::testGlx()
{
#if HAVE_EPOXY_GLX
#if HAVE_GLX
QFETCH(bool, requestVersion);
QFETCH(int, major);
QFETCH(int, minor);

@ -24,7 +24,7 @@ if (X11_Xi_FOUND)
target_link_libraries(KWinX11Platform X11::Xi)
endif()
if (HAVE_EPOXY_GLX)
if (HAVE_GLX)
target_sources(KWinX11Platform PRIVATE
x11_standalone_glx_backend.cpp
x11_standalone_glx_context_attribute_builder.cpp

@ -15,7 +15,7 @@
#include "x11_standalone_edge.h"
#include "x11_standalone_placeholderoutput.h"
#include "x11_standalone_windowselector.h"
#if HAVE_EPOXY_GLX
#if HAVE_GLX
#include "x11_standalone_glx_backend.h"
#endif
#if HAVE_X11_XINPUT
@ -156,7 +156,7 @@ bool X11StandaloneBackend::initialize()
std::unique_ptr<OpenGLBackend> X11StandaloneBackend::createOpenGLBackend()
{
switch (options->glPlatformInterface()) {
#if HAVE_EPOXY_GLX
#if HAVE_GLX
case GlxPlatformInterface:
if (hasGlx()) {
return std::make_unique<GlxBackend>(m_x11Display, this);
@ -258,7 +258,7 @@ void X11StandaloneBackend::createEffectsHandler(Compositor *compositor, Workspac
QVector<CompositingType> X11StandaloneBackend::supportedCompositors() const
{
QVector<CompositingType> compositors;
#if HAVE_EPOXY_GLX
#if HAVE_GLX
compositors << OpenGLCompositing;
#endif
compositors << NoCompositing;

@ -175,7 +175,7 @@ typedef void (*glXFuncPtr)();
static glXFuncPtr getProcAddress(const char *name)
{
glXFuncPtr ret = nullptr;
#if HAVE_EPOXY_GLX
#if ENABLE_GLX
ret = glXGetProcAddress((const GLubyte *)name);
#endif
#if HAVE_DL_LIBRARY

@ -336,7 +336,7 @@ QStringList CompositorDBusInterface::supportedOpenGLPlatformInterfaces() const
{
QStringList interfaces;
bool supportsGlx = false;
#if HAVE_EPOXY_GLX
#if HAVE_GLX
supportsGlx = (kwinApp()->operationMode() == Application::OperationModeX11);
#endif
if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES) {

@ -18,7 +18,7 @@
*/
#cmakedefine01 HAVE_EPOXY_GLX
#cmakedefine01 HAVE_GLX
#cmakedefine01 HAVE_DL_LIBRARY

@ -688,7 +688,7 @@ void Options::setGlPlatformInterface(OpenGLPlatformInterface interface)
qCDebug(KWIN_CORE) << "Forcing EGL native interface for Wayland mode";
interface = EglPlatformInterface;
}
#if !HAVE_EPOXY_GLX
#if !HAVE_GLX
qCDebug(KWIN_CORE) << "Forcing EGL native interface as compiled without GLX support";
interface = EglPlatformInterface;
#endif

@ -1633,8 +1633,8 @@ QString Workspace::supportInformation() const
support.append(KWIN_BUILD_ACTIVITIES ? yes : no);
support.append(QStringLiteral("HAVE_X11_XCB: "));
support.append(HAVE_X11_XCB ? yes : no);
support.append(QStringLiteral("HAVE_EPOXY_GLX: "));
support.append(HAVE_EPOXY_GLX ? yes : no);
support.append(QStringLiteral("HAVE_GLX: "));
support.append(HAVE_GLX ? yes : no);
support.append(QStringLiteral("\n"));
if (auto c = kwinApp()->x11Connection()) {

Loading…
Cancel
Save