Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c024083
feat(capture/linux): Add KWIN direct screencast capture method
Kishi85 Apr 16, 2026
ab8e5e6
feat(linux/kwingrab): Cleanup and add multi-monitor support based on …
Kishi85 Apr 17, 2026
da38c66
fix(linux/kwin): Create/update desktop permission file automatically …
Kishi85 Apr 18, 2026
5db0db2
fix(linux/kwin): Match output based on wl_output names not on display…
Kishi85 Apr 18, 2026
1a47ff7
feat(linux/kwin): Order outputs by KDE's screen priority
Kishi85 Apr 18, 2026
62f2fff
fix(linux/kwin): Add missing advanced config UI option
Kishi85 Apr 18, 2026
a1c3421
fix(linux/kwin): Drop CAP_SYS_ADMIN on encoder probing to allow KWin'…
Kishi85 Apr 18, 2026
06982b5
fix(linux/kwin): Fix verify_kwin in misc.cpp by using a separate check
Kishi85 Apr 19, 2026
3890b9a
fix(linux/kwin): Install a system application desktop file for KWin p…
Kishi85 Apr 19, 2026
2178ee8
fix(linux/kwin): Cleanup and unify naming
Kishi85 Apr 18, 2026
a075175
refactor(linux/kwin): Use a map with new struct for all output parame…
Kishi85 Apr 20, 2026
5b0d8ba
refactor(linux/kwin): Move kwin_available check logic into screencast_t
Kishi85 Apr 21, 2026
2c05a90
fix(linux/kwin): Reduce wayland logging verbosity and ensure output i…
Kishi85 Apr 21, 2026
11e5a61
fix(linux/kwin): Adapt to multi-monitor absolute touchinput fixes
Kishi85 Apr 22, 2026
4e2c86f
refactor(linux/kwin): Use constant from wayland protocol instead of r…
Kishi85 Apr 24, 2026
daa138f
refactor(linux/kwin): Restructure to make implementing future protoco…
Kishi85 Apr 26, 2026
09b4998
fix(linux/kwin): Only drop elevated privileges with active KWin permi…
Kishi85 Apr 28, 2026
d08c73a
feat(linux/kwin): Enable kwingrab in Linux Build script / COPR spec /…
Kishi85 Apr 21, 2026
bd564c1
docs(readme): Add KWin Screencast to the feature table
Kishi85 Apr 23, 2026
0bcad22
docs(configuration): Add kwin option to capture methods
Kishi85 Apr 29, 2026
e25a6df
feat(linux/kwin): Add support for zkde_screencast_unstable_v1 version 6
Kishi85 May 1, 2026
3c2b2c3
fix(linux/kwin): Requested review changes and cleanup
Kishi85 May 2, 2026
91d68dd
fix(linux): Remove sunshine binary version symlink
Kishi85 May 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci-freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ jobs:
-DSUNSHINE_EXECUTABLE_PATH=/usr/local/bin/sunshine \
-DSUNSHINE_ENABLE_CUDA=OFF \
-DSUNSHINE_ENABLE_DRM=OFF \
-DSUNSHINE_ENABLE_KWIN=ON \
Comment thread
Kishi85 marked this conversation as resolved.
-DSUNSHINE_ENABLE_PORTAL=ON \
-DSUNSHINE_ENABLE_WAYLAND=ON \
-DSUNSHINE_ENABLE_X11=ON \
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
path = third-party/nvapi
url = https://github.com/NVIDIA/nvapi.git
branch = main
[submodule "third-party/plasma-wayland-protocols"]
path = third-party/plasma-wayland-protocols
url = https://github.com/KDE/plasma-wayland-protocols.git
branch = master
[submodule "third-party/Simple-Web-Server"]
path = third-party/Simple-Web-Server
url = https://github.com/LizardByte-infrastructure/Simple-Web-Server.git
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,13 @@ LizardByte has the full documentation hosted on [Read the Docs](https://docs.liz
<td>➖</td>
<td>➖</td>
</tr>
<tr>
<td>KWin Screencast</td>
<td>✅</td>
<td>✅</td>
<td>➖</td>
<td>➖</td>
</tr>
</table>

<table>
Expand Down Expand Up @@ -322,6 +329,13 @@ LizardByte has the full documentation hosted on [Read the Docs](https://docs.liz
<td>✅</td>
<td>✅</td>
</tr>
<tr>
<td>KWin Screencast</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
</tr>
</table>

**Legend:** ✅ Supported | 🟡 Partial Support | ❌ Not Yet Supported | ➖ Not Applicable
Expand Down
30 changes: 22 additions & 8 deletions cmake/compile_definitions/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ if(CUDA_FOUND)
add_compile_definitions(SUNSHINE_BUILD_CUDA)
endif()

# libdrm is required for both DRM (KMS) and Wayland
if(${SUNSHINE_ENABLE_DRM} OR ${SUNSHINE_ENABLE_WAYLAND})
# libdrm is required for DRM (KMS), KWin ScreenCast and Wayland
if(${SUNSHINE_ENABLE_DRM} OR ${SUNSHINE_ENABLE_KWIN} OR ${SUNSHINE_ENABLE_WAYLAND})
find_package(LIBDRM REQUIRED)
else()
set(LIBDRM_FOUND OFF)
Expand Down Expand Up @@ -243,7 +243,7 @@ if(GIO_FOUND)
endif()

# Pipewire
if(${SUNSHINE_ENABLE_PORTAL})
if(${SUNSHINE_ENABLE_KWIN} OR ${SUNSHINE_ENABLE_PORTAL})
pkg_check_modules(PIPEWIRE libpipewire-0.3 REQUIRED)
else()
set(PIPEWIRE_FOUND OFF)
Expand All @@ -264,13 +264,27 @@ if(PIPEWIRE_FOUND AND GIO_FOUND AND ${SUNSHINE_ENABLE_PORTAL})
"${CMAKE_SOURCE_DIR}/src/platform/linux/portalgrab.cpp")
endif()

# KWin ScreenCast (direct Wayland protocol, bypasses portal)
set(KWIN_FOUND OFF)
if(PIPEWIRE_FOUND AND WAYLAND_FOUND AND ${SUNSHINE_ENABLE_KWIN})
set(KWIN_FOUND ON)
add_compile_definitions(SUNSHINE_BUILD_KWIN)
GEN_WAYLAND("${CMAKE_SOURCE_DIR}/third-party/plasma-wayland-protocols/src/protocols" "" kde-output-order-v1)
GEN_WAYLAND("${CMAKE_SOURCE_DIR}/third-party/plasma-wayland-protocols/src/protocols" "" zkde-screencast-unstable-v1)
list(APPEND PLATFORM_TARGET_FILES
"${CMAKE_SOURCE_DIR}/src/platform/linux/kwingrab.cpp")
elseif(${SUNSHINE_ENABLE_KWIN} AND NOT WAYLAND_FOUND)
message(FATAL_ERROR "SUNSHINE_ENABLE_KWIN requires SUNSHINE_ENABLE_WAYLAND — KWin capture disabled")
endif()

if(NOT ${CUDA_FOUND}
AND NOT ${WAYLAND_FOUND}
AND NOT ${X11_FOUND}
AND NOT ${PORTAL_FOUND}
AND NOT (${LIBDRM_FOUND} AND ${LIBCAP_FOUND})
AND NOT ${LIBVA_FOUND})
message(FATAL_ERROR "Couldn't find either cuda, libva, pipewire, wayland, x11, or (libdrm and libcap)")
AND NOT ${LIBVA_FOUND}
AND NOT ${KWIN_FOUND}
AND NOT ${PORTAL_FOUND}
AND NOT ${WAYLAND_FOUND}
AND NOT ${X11_FOUND})
message(FATAL_ERROR "Couldn't find either cuda, (libdrm and libcap), libva, kwin, pipewire, portal, wayland or x11")
endif()

# tray icon
Expand Down
4 changes: 4 additions & 0 deletions cmake/packaging/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_FQDN}.desktop"
if(NOT ${SUNSHINE_BUILD_APPIMAGE} AND NOT ${SUNSHINE_BUILD_FLATPAK})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_FQDN}.terminal.desktop"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
if(${SUNSHINE_ENABLE_KWIN})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_FQDN}.kwin.desktop"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
endif()
endif()

# metadata file
Expand Down
2 changes: 2 additions & 0 deletions cmake/prep/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ elseif(UNIX) # Linux
"Enable building wayland specific code." ON)
option(SUNSHINE_ENABLE_X11
"Enable X11 grab if available." ON)
option(SUNSHINE_ENABLE_KWIN
Comment thread
Kishi85 marked this conversation as resolved.
"Enable KWin ScreenCast grab if available" ON)
option(SUNSHINE_ENABLE_PORTAL
"Enable XDG portal grab if available" ON)
endif()
5 changes: 5 additions & 0 deletions cmake/prep/special_package_configuration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ elseif(UNIX)
# configure service
configure_file(packaging/linux/app-${PROJECT_FQDN}.service.in app-${PROJECT_FQDN}.service @ONLY)

# configure kwin desktop permission file
if (${SUNSHINE_ENABLE_KWIN})
configure_file(packaging/linux/${PROJECT_FQDN}.kwin.desktop.in ${PROJECT_FQDN}.kwin.desktop @ONLY)
endif()

# configure the arch linux pkgbuild
if(${SUNSHINE_CONFIGURE_PKGBUILD})
configure_file(packaging/linux/Arch/PKGBUILD PKGBUILD @ONLY)
Expand Down
10 changes: 1 addition & 9 deletions cmake/targets/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,7 @@ endif()

target_link_libraries(sunshine ${SUNSHINE_EXTERNAL_LIBRARIES} ${EXTRA_LIBS})
target_compile_definitions(sunshine PUBLIC ${SUNSHINE_DEFINITIONS})
if(APPLE AND NOT SUNSHINE_BUILD_HOMEBREW)
# codesign on Mac won't sign an .app that uses a symlink
set_target_properties(sunshine PROPERTIES CXX_STANDARD 23)
else()
# symlink sunshine -> sunshine-PROJECT_VERSION
set_target_properties(sunshine PROPERTIES CXX_STANDARD 23
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR})
endif()
set_target_properties(sunshine PROPERTIES CXX_STANDARD 23)

# CLion complains about unknown flags after running cmake, and cannot add symbols to the index for cuda files
if(CUDA_INHERIT_COMPILE_OPTIONS)
Expand Down
5 changes: 5 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2101,6 +2101,11 @@ editing the `conf` file in a text editor. Use the examples as reference.
<td>DRM/KMS screen capture from the kernel. This requires that Sunshine has `cap_sys_admin` capability.
@note{Applies to Linux only.}</td>
</tr>
<tr>
<td>kwin</td>
<td>Capture with KDE/KWin Wayland compositor via KDE screencasting.
@note{Applies to Linux only.}</td>
</tr>
<tr>
<td>x11</td>
<td>Uses XCB. This is the slowest and most CPU intensive so should be avoided if possible.
Expand Down
2 changes: 1 addition & 1 deletion packaging/linux/copr/Sunshine.spec
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ cmake_args=(
"-DSUNSHINE_ASSETS_DIR=%{_datadir}/sunshine"
"-DSUNSHINE_EXECUTABLE_PATH=%{_bindir}/sunshine"
"-DSUNSHINE_ENABLE_DRM=ON"
"-DSUNSHINE_ENABLE_KWIN=ON"
Comment thread
Kishi85 marked this conversation as resolved.
"-DSUNSHINE_ENABLE_PORTAL=ON"
"-DSUNSHINE_ENABLE_WAYLAND=ON"
"-DSUNSHINE_ENABLE_X11=ON"
Expand Down Expand Up @@ -405,7 +406,6 @@ fi
%files
# Executables
%caps(cap_sys_admin,cap_sys_nice+p) %{_bindir}/sunshine
%caps(cap_sys_admin,cap_sys_nice+p) %{_bindir}/sunshine-*

# Systemd unit files for user services
%{_userunitdir}/*.service
Expand Down
7 changes: 7 additions & 0 deletions packaging/linux/dev.lizardbyte.app.Sunshine.kwin.desktop.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Desktop Entry]
Exec=@SUNSHINE_EXECUTABLE_PATH@
X-KDE-Wayland-Interfaces=zkde_screencast_unstable_v1
Type=Application
Name=@PROJECT_FQDN@-kwin-wayland-permission
Comment=Sunshine KWin screencast permission
NoDisplay=true
1 change: 1 addition & 0 deletions packaging/linux/flatpak/dev.lizardbyte.app.Sunshine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ modules:
- -DSUNSHINE_EXECUTABLE_PATH=/app/bin/sunshine
- -DSUNSHINE_ENABLE_CUDA=ON
- -DSUNSHINE_ENABLE_DRM=ON
- -DSUNSHINE_ENABLE_KWIN=ON
Comment thread
Kishi85 marked this conversation as resolved.
- -DSUNSHINE_ENABLE_PORTAL=ON
- -DSUNSHINE_ENABLE_WAYLAND=ON
- -DSUNSHINE_ENABLE_X11=ON
Expand Down
1 change: 1 addition & 0 deletions scripts/linux_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ function run_step_cmake() {
"-DSUNSHINE_ASSETS_DIR=share/sunshine"
"-DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine"
"-DSUNSHINE_ENABLE_DRM=ON"
"-DSUNSHINE_ENABLE_KWIN=ON"
Comment thread
Kishi85 marked this conversation as resolved.
"-DSUNSHINE_ENABLE_PORTAL=ON"
"-DSUNSHINE_ENABLE_WAYLAND=ON"
"-DSUNSHINE_ENABLE_X11=ON"
Expand Down
Loading
Loading