From 72fd4011602c2d225ec3c68fe94e9ae4d03b9836 Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Sun, 22 Nov 2026 22:54:52 +0800 Subject: [PATCH] fix(session): set desktop identity before Xsession MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Declare DesktopNames=DDE so LightDM sets the desktop identity before Xsession. 2. Prevent stale values from the systemd user environment from overriding it. 3. Default to DDE when launching dde-session without a desktop identity. Log: Set the DDE desktop identity before Xsession syncs the activation environment. Influence: Early portals can use the DDE FileChooser. fix(session): 在 Xsession 前设置桌面标识 1. 声明 DesktopNames=DDE,让 LightDM 在进入 Xsession 前设置桌面标识。 2. 防止 systemd 用户环境中的旧值覆盖当前桌面标识。 3. 启动 dde-session 时若桌面标识为空,则补为 DDE。 Log: 在 Xsession 同步激活环境前设置 DDE 桌面标识。 PMS: BUG-382063 Influence: 提前启动的门户可使用 DDE 文件选择器。 --- misc/Xsession.d/00deepin-dde-env | 5 ++++- misc/xsessions/deepin.desktop.in | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/misc/Xsession.d/00deepin-dde-env b/misc/Xsession.d/00deepin-dde-env index 7ba96c5d..52653bba 100755 --- a/misc/Xsession.d/00deepin-dde-env +++ b/misc/Xsession.d/00deepin-dde-env @@ -5,7 +5,7 @@ # export systemd environment to avoid environment be replaced by dde-session # fix https://github.com/linuxdeepin/developer-center/issues/6225 # the following environment variables need to be excluded, otherwise it will affect the startup of some applications -EXCLUDED_ENV="XDG_VTNR\|XDG_SESSION_ID\|XDG_SEAT\|XDG_SESSION_TYPE\|XMODIFIERS\|GTK_IM_MODULE\|QT_IM_MODULE\|CLUTTER_IM_MODULE\|SDL_IM_MODULE" +EXCLUDED_ENV="XDG_VTNR\|XDG_SESSION_ID\|XDG_SEAT\|XDG_SESSION_TYPE\|XDG_CURRENT_DESKTOP\|XMODIFIERS\|GTK_IM_MODULE\|QT_IM_MODULE\|CLUTTER_IM_MODULE\|SDL_IM_MODULE" eval "$( busctl --json=short --user get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager Environment | @@ -61,6 +61,9 @@ if [ "$1" = "/usr/bin/dde-session" ]; then fi # set qt qpa platform type export QT_QPA_PLATFORM="dxcb;xcb" + if [ -z "$XDG_CURRENT_DESKTOP" ]; then + export XDG_CURRENT_DESKTOP="DDE" + fi # control qml softwarecontext in loongson-drm get_graphics_drivers "driver=loongson-drm" if [ $? -eq 0 ];then diff --git a/misc/xsessions/deepin.desktop.in b/misc/xsessions/deepin.desktop.in index 7ba9a197..e90dab06 100644 --- a/misc/xsessions/deepin.desktop.in +++ b/misc/xsessions/deepin.desktop.in @@ -3,3 +3,5 @@ Name=deepin Comment=Deepin Desktop Environment Exec=@CMAKE_INSTALL_FULL_BINDIR@/dde-session TryExec=@CMAKE_INSTALL_FULL_BINDIR@/dde-session +Type=Application +DesktopNames=DDE