feat: add attention state support for treeland task manager#1599
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 |
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
|
TAG Bot New tag: 2.0.43 |
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. 测试窗口获得焦点或用户与任务栏条目交互时注意力状态重置
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, wineee, yixinshark 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 |
deepin pr auto review你好!我是CodeGeeX。我已仔细审查了你提供的 Git Diff。本次代码变更主要涉及对 以下是针对语法逻辑、代码质量、代码性能和代码安全方面的详细审查意见及改进建议: 1. 语法与逻辑
2. 代码质量
3. 代码性能
4. 代码安全
总结整体改动目标明确,代码精简。主要需要关注的是空指针防御和状态变更信号的传递。建议修改后的核心代码如下: // treelandwindow.cpp
bool TreeLandWindow::isAttention()
{
// 增加空指针保护
if (!m_foreignToplevelHandle) {
return false;
}
return m_foreignToplevelHandle->state().contains(Attention);
}同时,请务必确认底层 Wayland 事件回调中,当 |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
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: