fix(topWindow): filter out dde-shell windows by correct WM_CLASS values#841
Merged
deepin-bot[bot] merged 1 commit intoMay 19, 2026
Merged
Conversation
Add "dde-shell/dock" and "org.deepin.dde-shell" to the exclusion list for topWindow screenshot, matching actual WM_CLASS values returned by dde-shell. 补充 "dde-shell/dock" 和 "org.deepin.dde-shell" 到窗口截图排除列表, 匹配 dde-shell 实际返回的 WM_CLASS 值。 Log: 修复Alt+PrintScreen截图误捕获dde-shell窗口的问题 PMS: BUG-361527 Influence: 修复后Alt+PrintScreen截图将正确跳过桌面环境窗口,不再误截dde-shell/dock
1c526a5 to
bccf3fe
Compare
deepin pr auto review你好!我是CodeGeeX。我已仔细审查了你提供的Git Diff代码。这次修改的主要目的是将硬编码的 但在语法逻辑、代码质量、性能和安全方面,我有以下改进意见: 1. 语法与逻辑
2. 代码性能
3. 代码质量
4. 代码安全
改进后的代码建议// 建议增加 window 的空指针检查,防止崩溃
if (!window) {
continue;
}
// 使用 const auto& 避免不必要的拷贝,配合 Qt 隐式共享更安全高效
const auto& wmClass = window->wmClass();
// 使用 QSet 替代 QVector,O(1) 查找性能,更符合语义
// 使用构造函数直接初始化,避免中间临时变量的开销
static const QSet<QString> excludedWmClasses = {
"dde-dock",
"dde-shell",
"dde-shell/dock",
"org.deepin.dde-shell"
};
if (excludedWmClasses.contains(wmClass)) {
qCDebug(dsrApp) << "topWindow excluded by wmClass:" << wmClass << ", continue";
continue;
}改进点总结:
|
lzwind
approved these changes
May 19, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dengzhongyuan365-dev, lzwind 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 |
Contributor
Author
|
/merge |
Contributor
|
This pr cannot be merged! (status: unstable) |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: unstable) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add "dde-shell/dock" and "org.deepin.dde-shell" to the exclusion list
for topWindow screenshot, matching actual WM_CLASS values returned by
dde-shell.
补充 "dde-shell/dock" 和 "org.deepin.dde-shell" 到窗口截图排除列表,
匹配 dde-shell 实际返回的 WM_CLASS 值。
Log: 修复Alt+PrintScreen截图误捕获dde-shell窗口的问题
PMS: BUG-361527
Influence: 修复后Alt+PrintScreen截图将正确跳过桌面环境窗口,不再误截dde-shell/dock