Inspect capture plugin dependencies and recognize XWayland sessions

This commit is contained in:
evgeny committed 2026-10-14 11:49:04 +02:00
1 parent 97c460e2f1
commit 27f3726124
3 files changed
+7 -4

No files matched your search

+3 -2
View File
@@ -98,8 +98,9 @@ QList<StreamVideoSource> StreamPublishEngine::sources() {
QList<StreamVideoSource> sources;
#ifdef HAVE_STREAM_CAPTURE
for (const auto& camera : QMediaDevices::videoInputs()) sources.push_back({StreamVideoSource::Camera, camera.description(), camera.id(), {}});
if (QGuiApplication::platformName().contains("wayland")) {
sources.push_back({StreamVideoSource::Screen, text("Screen or window (system selection)"), "portal", {}});
if (QGuiApplication::platformName().contains("wayland") || qEnvironmentVariable("XDG_SESSION_TYPE") == "wayland"
|| qEnvironmentVariableIsSet("WAYLAND_DISPLAY")) {
sources.push_back({StreamVideoSource::Screen, text("Screen (system selection)"), "portal", {}});
} else {
for (auto* screen : QGuiApplication::screens()) sources.push_back({StreamVideoSource::Screen, screen->name(), screen->name().toUtf8(), {}});
for (const auto& window : QWindowCapture::capturableWindows())