-
Notifications
You must be signed in to change notification settings - Fork 55
feat: ability to fine-tune cgroups-based appid detection #1328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
增加选项以供对于 cgroup 的应用识别场景,跳过指定应用程序的检查. 由于用户从终端执行带图形界面的应用程序的概率较大(例如 gitk, deepin-dconfig-edtor 等),这些应用必然无法匹配到一个 desktop id, 导致在经过 AM 的应用识别时,会根据其 cgroup 匹配到父进程的应用 id 上. 若要保留基于 cgroup 的识别则此问题基本没有合理的解决方案. 此提交引入了一个新的 dconfig 配置项,允许指定一个列表,表示希望跳 过基于 cgroup 的应用识别与合并的 appid 列表. 当 fallback 到 cgroup 识别且 cgroup 在此列表中,则此应用不再根据 cgroup 提取到的 appid 进行分组. 这个列表的值是 appid, 即 desktop-id 去掉 .desktop 后缀后剩余的部分. 此列表一般应当是终端模拟器的应用 id, 也可以将专门用于启动其他程 序的第三方启动器/工具添加到此列表中.例如 uTools 或者文件管理器. 另外此提交也把原本允许彻底禁用基于 cgroups 识别与分组的选项的逻 辑添加了回来. 另注: 1. 对于希望在 deepin 环境尽可能保持"deepin原生"行为的组件,应当 接入 dde-application-manager 来通过它启动应用 2. 所有应用仍然应当尽可能被正确安装到系统中,以确保其存在对应的 desktop-id/appid. 上述新增的配置项也仅适用于被正确安装/有应 用id的应用程序 Log:
deepin pr auto review我来对这个diff进行代码审查:
总结: |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR refines cgroup-based application detection by reintroducing the global toggle for grouping, adding a user-defined skip-list of app IDs, and updating the TaskManager logic and configuration schema to honor these new settings. Sequence diagram for cgroup-based appid detection with skip-listsequenceDiagram
participant "TaskManager"
participant "Settings"
participant "Model"
"TaskManager"->>"Settings": cgroupsBasedGrouping()
alt cgroupsBasedGrouping enabled
"TaskManager"->>"Settings": cgroupsBasedGroupingSkipIds()
"TaskManager"->>"TaskManager": getDesktopIdByPid(identifies)
alt desktopId not empty and not in skip-list
"TaskManager"->>"Model": match(desktopId)
alt match found
"TaskManager"->>"TaskManager": return result
end
end
end
Entity relationship diagram for new dconfig key and appid skip-listerDiagram
TASKMANAGER_DCONFIG {
string cgroupsBasedGrouping
string cgroupsBasedGroupingSkipAppIds
string dockedElements
}
TASKMANAGER_DCONFIG ||--o| APP : contains
APP {
string appid
}
TASKMANAGER_DCONFIG ||--|{ APP : skip-list cgroupsBasedGroupingSkipAppIds
Class diagram for updated TaskManagerSettings structureclassDiagram
class TaskManagerSettings {
- bool m_windowSplit
- bool m_cgroupsBasedGrouping
- QStringList m_dockedElements
- QStringList m_cgroupsBasedGroupingSkipAppIds
+ bool cgroupsBasedGrouping() const
+ QStringList cgroupsBasedGroupingSkipIds() const
+ void setWindowSplit(bool split)
+ void setDockedElements(const QStringList &elements)
+ void toggleDockedElement(const QString &element)
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- Register the new 'cgroupsBasedGroupingSkipAppIds' key in the dconf schema JSON with its default value to ensure it's recognized by the settings framework.
- Consider adding a debug log when an app ID is skipped due to being in the skip list to improve observability of grouping behavior.
- Normalize or validate the casing of desktop IDs in the skip list to prevent case-sensitivity mismatches during matching.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Register the new 'cgroupsBasedGroupingSkipAppIds' key in the dconf schema JSON with its default value to ensure it's recognized by the settings framework.
- Consider adding a debug log when an app ID is skipped due to being in the skip list to improve observability of grouping behavior.
- Normalize or validate the casing of desktop IDs in the skip list to prevent case-sensitivity mismatches during matching.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
增加选项以供对于 cgroup 的应用识别场景,跳过指定应用程序的检查.
由于用户从终端执行带图形界面的应用程序的概率较大(例如 gitk, deepin-dconfig-edtor 等),这些应用必然无法匹配到一个 desktop id, 导致在经过 AM 的应用识别时,会根据其 cgroup 匹配到父进程的应用 id 上. 若要保留基于 cgroup 的识别则此问题基本没有合理的解决方案.
此提交引入了一个新的 dconfig 配置项,允许指定一个列表,表示希望跳过基于 cgroup 的应用识别与合并的 appid 列表. 当 fallback 到 cgroup 识别且 cgroup 在此列表中,则此应用不再根据 cgroup 提取到的 appid 进行分组.
这个列表的值是 appid, 即 desktop-id 去掉 .desktop 后缀后剩余的部分. 此列表一般应当是终端模拟器的应用 id, 也可以将专门用于启动其他程序的第三方启动器/工具添加到此列表中.例如 uTools 或者文件管理器.
另外此提交也把原本允许彻底禁用基于 cgroups 识别与分组的选项的逻辑添加了回来.
另注:
Summary by Sourcery
Introduce a new skip-appids configuration to refine cgroup-based application detection and re-enable the existing option to disable cgroup grouping entirely
Enhancements:
Documentation: