-
Notifications
You must be signed in to change notification settings - Fork 58
feat: add X11 WM_CLASS support for layer shell windows #1425
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
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.
Sorry @18202781743, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, tsic404 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 |
1. Added xcb-icccm dependency to CMakeLists.txt for X11 ICCCM support 2. Modified DLayerShellWindow to have empty default scope instead of "window" 3. Implemented onScopeChanged() method to set WM_CLASS property on X11 windows 4. Connected scopeChanged signal to update WM_CLASS when scope changes 5. WM_CLASS is set using both instance and class name from the scope property Log: Layer shell windows now set WM_CLASS property on X11 for better window identification Influence: 1. Test layer shell windows on X11 display server 2. Verify WM_CLASS property is correctly set using xprop tool 3. Test scope changes dynamically update WM_CLASS 4. Verify empty scope doesn't set WM_CLASS property 5. Test backward compatibility with existing layer shell windows 6. Verify window managers can properly identify layer shell windows by class feat: 为层壳窗口添加X11 WM_CLASS支持 1. 在CMakeLists.txt中添加xcb-icccm依赖以支持X11 ICCCM 2. 修改DLayerShellWindow的scope默认值为空而不是"window" 3. 实现onScopeChanged()方法为X11窗口设置WM_CLASS属性 4. 连接scopeChanged信号以便在scope变化时更新WM_CLASS 5. WM_CLASS使用scope属性同时作为实例名和类名进行设置 Log: 层壳窗口现在会在X11上设置WM_CLASS属性,便于窗口识别 Influence: 1. 在X11显示服务器上测试层壳窗口 2. 使用xprop工具验证WM_CLASS属性是否正确设置 3. 测试scope变化时WM_CLASS是否动态更新 4. 验证空scope不会设置WM_CLASS属性 5. 测试与现有层壳窗口的向后兼容性 6. 验证窗口管理器能否通过类名正确识别层壳窗口
deepin pr auto review这段代码 diff 主要是在 X11 环境下为 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
总结与改进建议总体来说,这段代码质量很高,逻辑清晰,正确实现了功能。 唯一的改进建议(针对安全性/健壮性): 在 // ... 前面的代码 ...
QString instanceName = m_dlayerShellWindow->scope();
if (instanceName.isEmpty()) {
return;
}
QString className = QCoreApplication::applicationName();
// 安全性改进建议:检查是否包含非ASCII字符
// WM_CLASS 应当由 ASCII 字符组成,包含非 ASCII 字符可能导致窗口管理器识别异常
if (!instanceName.toLatin1().toUtf8().isEmpty() || !className.toLatin1().toUtf8().isEmpty()) {
qCWarning(layershell) << "WM_CLASS contains non-ASCII characters, which might not work correctly with all Window Managers.";
}
QByteArray wmClassData;
// ... 后面的代码 ...或者,如果确定只接受 ASCII,可以直接使用 最终评价:代码可以合并,逻辑完善,无明显缺陷。 |
"window"
windows
property
Log: Layer shell windows now set WM_CLASS property on X11 for better
window identification
Influence:
by class
feat: 为层壳窗口添加X11 WM_CLASS支持
Log: 层壳窗口现在会在X11上设置WM_CLASS属性,便于窗口识别
Influence: