From 43a6a640d05f57164dc98334a559a6dec3a3ce59 Mon Sep 17 00:00:00 2001 From: chenyuanbo Date: Tue, 20 Oct 2026 14:27:50 +0800 Subject: [PATCH] fix: clean up both LangSelector paths on logout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. The executable moved to /usr/libexec/deepin/langselector. /usr/lib/deepin-daemon/langselector remains a compatible entry point, using a wrapper and security loader to launch the new executable. 2. Logout cleanup only matched the old path, missing the actual process. Surviving processes retained their startup locale and cached translations, causing notifications to use a previous session's language. 3. Temporarily match both paths during logout, restricted to the current user. Anchor the command path and program name to avoid false matches. Abnormal session exits and reactivation after cleanup remain uncovered. Log: Fix stale notification translations after changing session language Influence: 1. Switch between English, Simplified Chinese and Traditional Chinese; log out and back in, then verify notification language. 2. Verify LangSelector processes from either path terminate on logout. 3. Verify cleanup does not affect other users or similarly named programs. fix: 注销时兼容清理新旧路径的 LangSelector 进程 1. LangSelector 的真实二进制已迁移至 /usr/libexec/deepin/langselector,旧路径 /usr/lib/deepin-daemon/langselector 保留为兼容启动入口, 通过 wrapper 和安全加载器启动新路径下的程序。 2. 原注销逻辑仅匹配旧路径,未覆盖新路径下的实际进程。 残留进程保留启动时的语言环境和翻译缓存,导致新会话切换语言时, 通知正文仍使用上一会话的语言。 3. 临时方案在注销时同时匹配新旧路径,兼容不同安装布局, 保留当前用户限制,并限定命令行起始位置和程序名边界, 避免误匹配其他进程。 此方案暂不覆盖会话异常退出及清理后再次激活的情况。 Log: 修复切换会话语言后通知正文沿用旧语言的问题 Influence: 1. 验证英文、简体中文、繁体中文之间切换并重新登录后的通知语言。 2. 验证新旧路径启动的 LangSelector 均能在注销时退出。 3. 验证不会清理其他用户的进程或名称相似的程序。 PMS: BUG-380095 --- src/dde-session/impl/sessionmanager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dde-session/impl/sessionmanager.cpp b/src/dde-session/impl/sessionmanager.cpp index cd69dfe..496783a 100644 --- a/src/dde-session/impl/sessionmanager.cpp +++ b/src/dde-session/impl/sessionmanager.cpp @@ -606,11 +606,15 @@ void SessionManager::stopSogouIme() void SessionManager::stopLangSelector() { // TODO 待优化,可以跟随当前用户一同退出 + // 匹配新旧两条路径的 langselector 进程: + // /usr/lib/deepin-daemon/langselector (旧兼容路径) + // /usr/libexec/deepin/langselector (新实际路径) EXEC_COMMAND("pkill" , QStringList() << "-ef" << "-u" - << QString::number(getuid()) << "/usr/lib/deepin-daemon/langselector" + << QString::number(getuid()) + << "^/usr/(lib/deepin-daemon|libexec/deepin)/langselector([[:space:]]|$)" ); }