From de5de23c0096483554410e54b7da62cac90f84ae Mon Sep 17 00:00:00 2001 From: zhangkun Date: Wed, 7 May 2025 14:16:03 +0800 Subject: [PATCH] fix: remove DSG_APP_ID from notification action When starting a child process, do not inherit the DSG_APP-ID environment variable to prevent direct modification of dde shell configuration by the child process pms: BUG-315007 --- panels/notification/server/notificationmanager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/panels/notification/server/notificationmanager.cpp b/panels/notification/server/notificationmanager.cpp index 574de9c9a..bceab4ced 100644 --- a/panels/notification/server/notificationmanager.cpp +++ b/panels/notification/server/notificationmanager.cpp @@ -509,7 +509,14 @@ void NotificationManager::doActionInvoked(const NotifyEntity &entity, const QStr QStringList args = i.value().toString().split(","); if (!args.isEmpty()) { QString cmd = args.takeFirst(); // 命令 - QProcess::startDetached(cmd, args); //执行相关命令 + + QProcess pro; + pro.setProgram(cmd); + pro.setArguments(args); + QProcessEnvironment proEnv = QProcessEnvironment::systemEnvironment(); + proEnv.remove("DSG_APP_ID"); + pro.setProcessEnvironment(proEnv); + pro.startDetached(); } } else if (i.key() == "deepin-dde-shell-action-" + actionId) { const QString data(i.value().toString());