Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 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 @@ -174,6 +174,7 @@ jobs:
-DSUNSHINE_ENABLE_CUDA=OFF \
-DSUNSHINE_ENABLE_DRM=OFF \
-DSUNSHINE_ENABLE_PORTAL=ON \
-DSUNSHINE_ENABLE_KWIN=ON \
Comment thread
Kishi85 marked this conversation as resolved.
-DSUNSHINE_ENABLE_WAYLAND=ON \
-DSUNSHINE_ENABLE_X11=ON \
-DSUNSHINE_PUBLISHER_NAME="${GITHUB_REPOSITORY_OWNER}" \
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@
path = third-party/wlr-protocols
url = https://github.com/LizardByte-infrastructure/wlr-protocols.git
branch = master
[submodule "third-party/plasma-wayland-protocols"]
Comment thread
Kishi85 marked this conversation as resolved.
Outdated
Comment thread
Kishi85 marked this conversation as resolved.
Outdated
path = third-party/plasma-wayland-protocols
url = https://github.com/KDE/plasma-wayland-protocols.git
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
20 changes: 17 additions & 3 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), Wayland, and KWin ScreenCast
if(${SUNSHINE_ENABLE_DRM} OR ${SUNSHINE_ENABLE_WAYLAND} OR ${SUNSHINE_ENABLE_KWIN})
Comment thread
Kishi85 marked this conversation as resolved.
Outdated
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_PORTAL} OR ${SUNSHINE_ENABLE_KWIN})
Comment thread
Kishi85 marked this conversation as resolved.
Outdated
pkg_check_modules(PIPEWIRE libpipewire-0.3 REQUIRED)
else()
set(PIPEWIRE_FOUND OFF)
Expand All @@ -264,10 +264,24 @@ 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(WAYLAND_FOUND AND PIPEWIRE_FOUND AND ${SUNSHINE_ENABLE_KWIN})
Comment thread
Kishi85 marked this conversation as resolved.
Outdated
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(WARNING "SUNSHINE_ENABLE_KWIN requires SUNSHINE_ENABLE_WAYLAND — KWin capture disabled")
Comment thread
Kishi85 marked this conversation as resolved.
Outdated
endif()

if(NOT ${CUDA_FOUND}
AND NOT ${WAYLAND_FOUND}
AND NOT ${X11_FOUND}
AND NOT ${PORTAL_FOUND}
AND NOT ${KWIN_FOUND}
Comment thread
Kishi85 marked this conversation as resolved.
Outdated
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)")
Expand Down
4 changes: 4 additions & 0 deletions cmake/packaging/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ 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")
endif()
if(${SUNSHINE_ENABLE_KWIN})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_FQDN}.kwin.desktop"
Comment thread
Kishi85 marked this conversation as resolved.
Outdated
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
endif()

# metadata file
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_FQDN}.metainfo.xml"
Expand Down
8 changes: 8 additions & 0 deletions cmake/prep/init.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ elseif (UNIX)
if(NOT DEFINED SUNSHINE_EXECUTABLE_PATH)
set(SUNSHINE_EXECUTABLE_PATH "sunshine")
endif()
if(NOT DEFINED SUNSHINE_REAL_EXECUTABLE_PATH)
Comment thread
Kishi85 marked this conversation as resolved.
Outdated
if(SUNSHINE_BUILD_HOMEBREW)
set(SUNSHINE_REAL_EXECUTABLE_PATH ${SUNSHINE_EXECUTABLE_PATH})
else()
# The real executable is behind a symlink to SUNSHINE_EXECUTABLE_PATH-PROJECT_VERSION
set(SUNSHINE_REAL_EXECUTABLE_PATH ${SUNSHINE_EXECUTABLE_PATH}-${PROJECT_VERSION})
endif()
endif()

if(SUNSHINE_BUILD_FLATPAK)
set(SUNSHINE_SERVICE_START_COMMAND "ExecStart=flatpak run --command=sunshine ${PROJECT_FQDN}")
Expand Down
2 changes: 2 additions & 0 deletions cmake/prep/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,6 @@ elseif(UNIX) # Linux
"Enable X11 grab if available." ON)
option(SUNSHINE_ENABLE_PORTAL
"Enable XDG portal grab if available" ON)
option(SUNSHINE_ENABLE_KWIN
Comment thread
Kishi85 marked this conversation as resolved.
"Enable KWin ScreenCast 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
5 changes: 5 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2117,6 +2117,11 @@ editing the `conf` file in a text editor. Use the examples as reference.
@note{Applies to Windows only.}
@attention{This capture method is not compatible with the Sunshine service.}</td>
</tr>
<tr>
<td>kwin</td>
<td>Capture with KDE/KWin Wayland compositor via zkde-screencast-unstable-v1.
@note{Applies to Linux only.}</td>
</tr>
Comment thread
Kishi85 marked this conversation as resolved.
Outdated
</table>

### encoder
Expand Down
1 change: 1 addition & 0 deletions packaging/linux/copr/Sunshine.spec
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ cmake_args=(
"-DSUNSHINE_EXECUTABLE_PATH=%{_bindir}/sunshine"
"-DSUNSHINE_ENABLE_DRM=ON"
"-DSUNSHINE_ENABLE_PORTAL=ON"
"-DSUNSHINE_ENABLE_KWIN=ON"
Comment thread
Kishi85 marked this conversation as resolved.
"-DSUNSHINE_ENABLE_WAYLAND=ON"
"-DSUNSHINE_ENABLE_X11=ON"
"-DSUNSHINE_PUBLISHER_NAME=LizardByte"
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_REAL_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 @@ -83,6 +83,7 @@ modules:
- -DSUNSHINE_ENABLE_CUDA=ON
- -DSUNSHINE_ENABLE_DRM=ON
- -DSUNSHINE_ENABLE_PORTAL=ON
- -DSUNSHINE_ENABLE_KWIN=ON
Comment thread
Kishi85 marked this conversation as resolved.
- -DSUNSHINE_ENABLE_WAYLAND=ON
- -DSUNSHINE_ENABLE_X11=ON
- -DSUNSHINE_PUBLISHER_NAME='LizardByte'
Expand Down
1 change: 1 addition & 0 deletions scripts/linux_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ function run_step_cmake() {
"-DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine"
"-DSUNSHINE_ENABLE_DRM=ON"
"-DSUNSHINE_ENABLE_PORTAL=ON"
"-DSUNSHINE_ENABLE_KWIN=ON"
Comment thread
Kishi85 marked this conversation as resolved.
"-DSUNSHINE_ENABLE_WAYLAND=ON"
"-DSUNSHINE_ENABLE_X11=ON"
)
Expand Down
Loading
Loading