Skip to content

Commit

Permalink
fix: XDG_CURRENT_DESKTOP is wrong
Browse files Browse the repository at this point in the history
use DDE as XDG_CURRENT_DESKTOP

Log:
  • Loading branch information
justforlxz committed Dec 22, 2023
1 parent b16915c commit bb4eb37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion data/wayland-sessions/treeland.desktop.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Comment=This session is DDE single wayland
Exec=${CMAKE_INSTALL_FULL_LIBEXECDIR}/treeland-fake-session
TryExec=${CMAKE_INSTALL_FULL_LIBEXECDIR}/treeland-fake-session
Type=Application
DesktopNames=TreeLand
DesktopNames=DDE
X-DDE-SINGLE-WAYLAND=true
7 changes: 4 additions & 3 deletions src/treeland/treeland-fake-session/fake-session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,12 @@ FakeSession::FakeSession(int argc, char* argv[])
QProcess::startDetached("dde-shell", {"-p", "org.deepin.ds.dock"});

QDBusInterface systemd("org.freedesktop.systemd1", "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager");
systemd.call("UnsetEnvironment", QStringList{"DISPLAY", "WAYLAND_DISPLAY", "XDG_SESSION_TYPE", "XDG_CURRENT_DESKTOP"});
systemd.call("UnsetEnvironment", QStringList{"DISPLAY", "WAYLAND_DISPLAY", "XDG_SESSION_TYPE"});
systemd.call("SetEnvironment", QStringList{
"XDG_CURRENT_DESKTOP=DDE",
QString("DISPLAY=%1").arg(qgetenv("DISPLAY")),
QString("WAYLAND_DISPLAY=%1").arg(qgetenv("WAYLAND_DISPLAY")),
"XDG_SESSION_TYPE=wayland"
QString("XDG_SESSION_TYPE=%1").arg(qgetenv("XDG_SESSION_TYPE")),
QString("XDG_CURRENT_DESKTOP=%1").arg(qgetenv("XDG_CURRENT_DESKTOP")),
}
);
}
Expand Down

0 comments on commit bb4eb37

Please sign in to comment.