From 592633eed7daa9c03d43b5ca4f4b7efd9d1cbcff Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 8 Dec 2020 11:17:56 +0200 Subject: [PATCH] Fix KWIN_BUILD_XRENDER_COMPOSITING build option --- platform.cpp | 2 ++ platform.h | 4 ++++ platformsupport/scenes/CMakeLists.txt | 4 +++- plugins/platforms/x11/standalone/CMakeLists.txt | 8 ++++++-- plugins/platforms/x11/standalone/x11_platform.cpp | 4 ++++ plugins/platforms/x11/standalone/x11_platform.h | 2 ++ 6 files changed, 21 insertions(+), 3 deletions(-) diff --git a/platform.cpp b/platform.cpp index 926bf2e059..4fa717df76 100644 --- a/platform.cpp +++ b/platform.cpp @@ -90,10 +90,12 @@ QPainterBackend *Platform::createQPainterBackend() return nullptr; } +#ifdef KWIN_HAVE_XRENDER_COMPOSITING XRenderBackend *Platform::createXRenderBackend() { return nullptr; } +#endif void Platform::prepareShutdown() { diff --git a/platform.h b/platform.h index ae490752da..49243ce392 100644 --- a/platform.h +++ b/platform.h @@ -42,7 +42,9 @@ class Scene; class Screens; class ScreenEdges; class Toplevel; +#ifdef KWIN_HAVE_XRENDER_COMPOSITING class XRenderBackend; +#endif namespace Decoration { @@ -71,7 +73,9 @@ public: virtual Screens *createScreens(QObject *parent = nullptr); virtual OpenGLBackend *createOpenGLBackend(); virtual QPainterBackend *createQPainterBackend(); +#ifdef KWIN_HAVE_XRENDER_COMPOSITING virtual XRenderBackend *createXRenderBackend(); +#endif virtual DmaBufTexture *createDmaBufTexture(const QSize &size) { Q_UNUSED(size); return nullptr; diff --git a/platformsupport/scenes/CMakeLists.txt b/platformsupport/scenes/CMakeLists.txt index c3b0b166a0..50a2aac8ca 100644 --- a/platformsupport/scenes/CMakeLists.txt +++ b/platformsupport/scenes/CMakeLists.txt @@ -1,3 +1,5 @@ add_subdirectory(qpainter) add_subdirectory(opengl) -add_subdirectory(xrender) +if (KWIN_BUILD_XRENDER_COMPOSITING) + add_subdirectory(xrender) +endif() diff --git a/plugins/platforms/x11/standalone/CMakeLists.txt b/plugins/platforms/x11/standalone/CMakeLists.txt index bf7ce30054..c48bc9bcd6 100644 --- a/plugins/platforms/x11/standalone/CMakeLists.txt +++ b/plugins/platforms/x11/standalone/CMakeLists.txt @@ -12,7 +12,6 @@ set(X11PLATFORM_SOURCES x11_output.cpp x11_platform.cpp x11cursor.cpp - x11xrenderbackend.cpp xfixes_cursor_event_filter.cpp ) @@ -29,11 +28,16 @@ include_directories(${CMAKE_SOURCE_DIR}/platformsupport/scenes/xrender) add_library(KWinX11Platform MODULE ${X11PLATFORM_SOURCES}) set_target_properties(KWinX11Platform PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/org.kde.kwin.platforms/") -target_link_libraries(KWinX11Platform eglx11common kwin kwinxrenderutils SceneOpenGLBackend SceneXRenderBackend Qt5::X11Extras XCB::CURSOR KF5::Crash ) +target_link_libraries(KWinX11Platform eglx11common kwin kwinxrenderutils SceneOpenGLBackend Qt5::X11Extras XCB::CURSOR KF5::Crash ) if (X11_Xinput_FOUND) target_link_libraries(KWinX11Platform ${X11_Xinput_LIB}) endif() +if (KWIN_BUILD_XRENDER_COMPOSITING) + target_sources(KWinX11Platform PRIVATE x11xrenderbackend.cpp) + target_link_libraries(KWinX11Platform SceneXRenderBackend) +endif() + if (HAVE_DL_LIBRARY) target_link_libraries(KWinX11Platform ${DL_LIBRARY}) endif() diff --git a/plugins/platforms/x11/standalone/x11_platform.cpp b/plugins/platforms/x11/standalone/x11_platform.cpp index 2a5e0fc231..256188252b 100644 --- a/plugins/platforms/x11/standalone/x11_platform.cpp +++ b/plugins/platforms/x11/standalone/x11_platform.cpp @@ -10,7 +10,9 @@ #include "x11cursor.h" #include "edge.h" #include "windowselector.h" +#ifdef KWIN_HAVE_XRENDER_COMPOSITING #include "x11xrenderbackend.h" +#endif #include #include #if HAVE_EPOXY_GLX @@ -120,10 +122,12 @@ OpenGLBackend *X11StandalonePlatform::createOpenGLBackend() } } +#ifdef KWIN_HAVE_XRENDER_COMPOSITING XRenderBackend *X11StandalonePlatform::createXRenderBackend() { return new X11XRenderBackend(this); } +#endif Edge *X11StandalonePlatform::createScreenEdge(ScreenEdges *edges) { diff --git a/plugins/platforms/x11/standalone/x11_platform.h b/plugins/platforms/x11/standalone/x11_platform.h index 7c1fe9d8eb..e35568c479 100644 --- a/plugins/platforms/x11/standalone/x11_platform.h +++ b/plugins/platforms/x11/standalone/x11_platform.h @@ -35,7 +35,9 @@ public: Screens *createScreens(QObject *parent = nullptr) override; OpenGLBackend *createOpenGLBackend() override; +#ifdef KWIN_HAVE_XRENDER_COMPOSITING XRenderBackend *createXRenderBackend() override; +#endif Edge *createScreenEdge(ScreenEdges *parent) override; void createPlatformCursor(QObject *parent = nullptr) override; bool requiresCompositing() const override;