Skip to content

Commit

Permalink
fix: Video wallpaper adaptation to wayland egl
Browse files Browse the repository at this point in the history
Video wallpaper adaptation to wayland egl

Bug: https://pms.uniontech.com/bug-view-261717.html
Log: Video wallpaper adaptation to wayland egl
  • Loading branch information
myk1343 committed Jun 28, 2024
1 parent bd111f9 commit 2010f18
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/apps/dde-desktop/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down

0 comments on commit 2010f18

Please sign in to comment.