From 2010f18b5b8932cb12e4a4639732bfb8e4fb2e23 Mon Sep 17 00:00:00 2001 From: muyuankai Date: Fri, 28 Jun 2024 18:38:33 +0800 Subject: [PATCH] fix: Video wallpaper adaptation to wayland egl Video wallpaper adaptation to wayland egl Bug: https://pms.uniontech.com/bug-view-261717.html Log: Video wallpaper adaptation to wayland egl --- src/apps/dde-desktop/main.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/apps/dde-desktop/main.cpp b/src/apps/dde-desktop/main.cpp index f287d19654..11da78f53f 100644 --- a/src/apps/dde-desktop/main.cpp +++ b/src/apps/dde-desktop/main.cpp @@ -238,9 +238,21 @@ static void waitingForKwin() qCWarning(logAppDesktop) << "waiting for kwin ready cost" << elapsed << "ms"; } +bool first_check_wayland_env() +{ + auto e = QProcessEnvironment::systemEnvironment(); + QString XDG_SESSION_TYPE = e.value(QStringLiteral("XDG_SESSION_TYPE")); + QString WAYLAND_DISPLAY = e.value(QStringLiteral("WAYLAND_DISPLAY")); + + if (XDG_SESSION_TYPE == QLatin1String("wayland") || WAYLAND_DISPLAY.contains(QLatin1String("wayland"), Qt::CaseInsensitive)) { + return true; + } else { + return false; + } +} int main(int argc, char *argv[]) { - if(WindowUtils::isWayLand()) { + if(first_check_wayland_env()) { qputenv("QT_WAYLAND_SHELL_INTEGRATION", "kwayland-shell"); setenv("PULSE_PROP_media.role", "video", 1); #ifndef __x86_64__