diff --git a/CMakeLists.txt b/CMakeLists.txt index 97b88e0600..eee10b5dad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -755,9 +755,6 @@ ecm_qt_declare_logging_category(kwin_XWAYLAND_SRCS set(kwin_WAYLAND_SRCS main_wayland.cpp - screencast/screencastmanager.cpp - screencast/pipewirecore.cpp - screencast/pipewirestream.cpp tabletmodemanager.cpp ) ecm_qt_declare_logging_category(kwin_WAYLAND_SRCS @@ -772,9 +769,19 @@ ecm_qt_declare_logging_category(kwin_WAYLAND_SRCS ) add_executable(kwin_wayland ${kwin_WAYLAND_SRCS} ${kwin_XWAYLAND_SRCS}) + + +if (PipeWire_FOUND) + target_sources(kwin_wayland + PRIVATE + screencast/screencastmanager.cpp + screencast/pipewirecore.cpp + screencast/pipewirestream.cpp) + target_link_libraries(kwin_wayland PkgConfig::PipeWire) +endif() + target_link_libraries(kwin_wayland kwin - PkgConfig::PipeWire # required for PipewireStream KF5::Crash ) if (HAVE_LIBCAP) diff --git a/config-kwin.h.cmake b/config-kwin.h.cmake index 9e900d65fa..7ea93e92d0 100644 --- a/config-kwin.h.cmake +++ b/config-kwin.h.cmake @@ -42,3 +42,5 @@ #define XCB_ICCCM_WM_STATE_NORMAL 1 #define XCB_ICCCM_WM_STATE_ICONIC 3 #endif + +#cmakedefine01 PipeWire_FOUND diff --git a/main_wayland.cpp b/main_wayland.cpp index 81ac441a55..b3dff99798 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -26,7 +26,10 @@ along with this program. If not, see . #include "platform.h" #include "effects.h" #include "tabletmodemanager.h" + +#ifdef PipeWire_FOUND #include "screencast/screencastmanager.h" +#endif #include "wayland_server.h" #include "xwl/xwayland.h" @@ -165,7 +168,9 @@ void ApplicationWayland::performStartup() VirtualKeyboard::create(this); createBackend(); TabletModeManager::create(this); +#ifdef PipeWire_FOUND new ScreencastManager(this); +#endif } void ApplicationWayland::createBackend() diff --git a/wayland_server.cpp b/wayland_server.cpp index 4d5f6c9e9d..887adb53ba 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -458,7 +458,9 @@ bool WaylandServer::init(const QByteArray &socketName, InitializationFlags flags m_keyState = m_display->createKeyStateInterface(m_display); m_keyState->create(); +#ifdef PipeWire_FOUND m_screencast = m_display->createScreencastInterface(m_display); +#endif return true; }