1
0
mirror of https://invent.kde.org/network/krfb synced 2024-07-01 07:24:29 +00:00
krfb/framebuffers/pipewire/CMakeLists.txt
Prajna Sariputra f071ad4eba wayland: Add support for the persistence feature of the remote desktop portal
Same idea as https://invent.kde.org/network/kdeconnect-kde/-/merge_requests/639, v2 of the remote desktop portal can accept and return a restore token that we can use to avoid constantly asking the user for permission every time Krfb is started.

Note that there's a bug in `xdg-desktop-portal-kde` that breaks persistence if it's restarted for whatever reason, for example when rebooting (see https://bugs.kde.org/show_bug.cgi?id=480235 and https://invent.kde.org/network/kdeconnect-kde/-/merge_requests/639#note_859651 for more details), so at the moment this only works when restarting Krfb in the same session.
2024-06-01 12:27:07 +00:00

73 lines
2.0 KiB
CMake

include_directories (${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
set (krfb_framebuffer_pw_SRCS
pw_framebuffer.cpp
pw_framebufferplugin.cpp
screencasting.cpp
)
ecm_qt_declare_logging_category(krfb_framebuffer_pw_SRCS
HEADER krfb_fb_pipewire_debug.h
IDENTIFIER KRFB_FB_PIPEWIRE
CATEGORY_NAME krfb.framebuffer.pipewire
DESCRIPTION "KRFB PipeWire framebuffer plugin"
EXPORT KRFB
)
qt_add_dbus_interface(
krfb_framebuffer_pw_SRCS
${CMAKE_SOURCE_DIR}/dbus/xdp_dbus_screencast_interface.xml
xdp_dbus_screencast_interface
)
qt_add_dbus_interface(
krfb_framebuffer_pw_SRCS
${CMAKE_SOURCE_DIR}/dbus/xdp_dbus_remotedesktop_interface.xml
xdp_dbus_remotedesktop_interface
)
add_library(krfb_framebuffer_pw
MODULE
${krfb_framebuffer_pw_SRCS}
)
if (Qt6_VERSION VERSION_LESS "6.7.1")
ecm_add_qtwayland_client_protocol(krfb_framebuffer_pw
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/screencast.xml
BASENAME zkde-screencast-unstable-v1
)
else()
qt6_generate_wayland_protocol_client_sources(krfb_framebuffer_pw
FILES ${PLASMA_WAYLAND_PROTOCOLS_DIR}/screencast.xml
)
endif()
if (KPipeWire_VERSION VERSION_LESS "6.0.80")
target_compile_definitions(krfb_framebuffer_pw PRIVATE -DKPIPEWIRE60=1)
else()
target_compile_definitions(krfb_framebuffer_pw PRIVATE -DKPIPEWIRE60=0)
endif()
set_property(TARGET krfb_framebuffer_pw PROPERTY C_STANDARD 99)
target_link_libraries(krfb_framebuffer_pw
Qt::Core
Qt::Gui
Qt::DBus
KF6::CoreAddons
KF6::ConfigCore
PkgConfig::PipeWire
Plasma::KWaylandClient
Wayland::Client
krfbprivate
K::KPipeWire
K::KPipeWireDmaBuf
)
set_target_properties(krfb_framebuffer_pw PROPERTIES OUTPUT_NAME pw)
install (TARGETS krfb_framebuffer_pw
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/framebuffer
)