feat: add attention state support for treeland task manager#1599
feat: add attention state support for treeland task manager#159918202781743 wants to merge 1 commit into
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds Treeland window attention state support in the dock task manager by updating the Treeland protocol usage, switching to a bundled XML protocol file, and wiring the new attention state into TreeLandWindow and its Wayland extensions. Sequence diagram for Treeland attention state check in task managersequenceDiagram
participant Taskbar
participant TreeLandWindow
participant ForeignToplevelHandle
Taskbar->>TreeLandWindow: isAttention()
TreeLandWindow->>ForeignToplevelHandle: state()
ForeignToplevelHandle-->>TreeLandWindow:
TreeLandWindow-->>Taskbar:
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- TreeLandWindow::isAttention() assumes m_foreignToplevelHandle is always valid and ready; consider guarding against a null or not-yet-initialized handle to avoid potential crashes during startup or teardown.
- Now that the foreign toplevel extensions request version 2, it would be good to explicitly handle the case where the compositor only supports v1 (e.g., by checking the advertised version or feature flags) to preserve backward compatibility described in the PR.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- TreeLandWindow::isAttention() assumes m_foreignToplevelHandle is always valid and ready; consider guarding against a null or not-yet-initialized handle to avoid potential crashes during startup or teardown.
- Now that the foreign toplevel extensions request version 2, it would be good to explicitly handle the case where the compositor only supports v1 (e.g., by checking the advertised version or feature flags) to preserve backward compatibility described in the PR.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
TAG Bot New tag: 2.0.42 |
1. Bump treeland-protocols dependency to version > 0.5.7 to ensure protocol compatibility 2. Use local protocol XML file instead of system-installed one for easier development and stability 3. Add Attention state handling to TreeLandWindow, enabling taskbar to reflect window attention state 4. Update wayland extension versions to v2 for both ForeignToplevelHandle and ForeignToplevelManager to utilize new protocol features 5. Implement isAttention() method to check attention state from foreign toplevel handle Log: Taskbar now supports treeland window attention state display Influence: 1. Test taskbar window entries show attention state (e.g., flashing/ urgent) when window requests attention 2. Verify normal window behavior without attention state remains unchanged 3. Test with treeland compositor version >= 0.5.7 to ensure protocol compatibility 4. Verify backward compatibility with older treeland versions (if applicable) 5. Test attention state reset when window gains focus or user interacts with taskbar entry feat: 为treeland任务管理器添加注意力状态支持 1. 将treeland-protocols依赖提升至>=0.5.7版本以确保协议兼容性 2. 使用本地协议XML文件替代系统安装的协议文件,便于开发和保持稳定性 3. 为TreeLandWindow添加注意力状态处理,使任务栏能够反映窗口的注意力请求 4. 将ForeignToplevelHandle和ForeignToplevelManager的wayland扩展版本更新 至v2,以利用新协议特性 5. 实现isAttention()方法,从foreign toplevel handle中检查注意力状态 Log: 任务栏现在支持treeland窗口注意力状态显示 Influence: 1. 测试任务栏窗口条目在窗口请求注意力时显示注意力状态(如闪烁/紧急状态) 2. 验证无注意力状态的窗口行为保持不变 3. 使用treeland合成器版本>=0.5.7测试,确保协议兼容性 4. 验证与旧版本treeland的向后兼容性(如适用) 5. 测试窗口获得焦点或用户与任务栏条目交互时注意力状态重置
There was a problem hiding this comment.
Sorry @18202781743, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
deepin pr auto review你好!我是CodeGeeX。我已经仔细审查了你提供的 Git Diff。这次修改的主要目的是为 整体来看,修改逻辑清晰,目标明确。以下是我从语法逻辑、代码质量、代码性能和代码安全四个维度提出的详细审查意见和改进建议: 1. 语法与逻辑
2. 代码质量
3. 代码性能
4. 代码安全
改进后的代码建议针对 修改前: bool TreeLandWindow::isAttention()
{
return m_foreignToplevelHandle->state().contains(Attention);
}修改后: bool TreeLandWindow::isAttention() const // 建议加上 const 修饰
{
if (!m_foreignToplevelHandle) {
qCWarning(waylandwindowLog) << "ForeignToplevelHandle is null in isAttention";
return false;
}
return m_foreignToplevelHandle->state().contains(Attention);
}(注意:请同步在 关于版权年份的建议: // SPDX-FileCopyrightText: 2023 - 2024 UnionTech Software Technology Co., Ltd.总结这次 Diff 的核心功能实现没有问题,依赖版本限制非常到位。主要的风险点在于 空指针解引用,建议加上非空校验以增强代码的健壮性。版权年份的问题建议与团队确认是否符合内部规范。其余部分质量很高,可以合并。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, wineee 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 |
protocol compatibility
easier development and stability
reflect window attention state
ForeignToplevelHandle and ForeignToplevelManager to utilize new protocol
features
toplevel handle
Log: Taskbar now supports treeland window attention state display
Influence:
urgent) when window requests attention
unchanged
compatibility
applicable)
with taskbar entry
feat: 为treeland任务管理器添加注意力状态支持
至v2,以利用新协议特性
Log: 任务栏现在支持treeland窗口注意力状态显示
Influence:
Summary by Sourcery
Add support for Treeland window attention state in the dock task manager and update Treeland Wayland protocol integration.
New Features:
Enhancements:
Build: