Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wjyrich 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 |
Reviewer's GuideAdds a configurable PanelPopup inactivity-close policy, makes DockPositioner available geometry follow the panel’s current screen, and adds headless QML lifecycle tests registered through CTest. Sequence diagram for PanelPopup inactivity close policysequenceDiagram
participant PopupWindow
participant PanelPopup
participant QMLTest
QMLTest->>PanelPopup: open()
PanelPopup->>PopupWindow: currentItem = PanelPopup
PopupWindow-->>PanelPopup: activeChanged
alt closeOnInactive is true
PanelPopup->>PanelPopup: close()
PanelPopup->>PopupWindow: currentItem = null
else closeOnInactive is false
PanelPopup-->>QMLTest: remains open
end
QMLTest->>PanelPopup: closeOnInactive = false
PopupWindow-->>PanelPopup: activeChanged
PanelPopup-->>QMLTest: remains open
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
1. Add closeOnInactive property to PanelPopup to allow popups to stay open when the window becomes inactive 2. Guard all internal auto-close paths (focus loss, grab timeout, ungrab, interaction end) behind closeOnInactive 3. Track the panel's QWindow screen in DockPositioner and expose availableGeometry with change notifications 4. Reconnect screen signals on screenChanged to follow panels moved across screens 5. Fix popup parent fallback from undefined to null for cleaner QML binding semantics 6. Add QML lifecycle smoke tests for PanelPopup covering open/close, shared window switching, and focus loss scenarios 7. Wire qmltestrunner into CTest with offscreen platform for headless popup policy testing Log: Added closeOnInactive option for panel popups and availableGeometry tracking in DockPositioner Influence: 1. Test popup open/close toggle behavior with repeated clicks 2. Verify popups remain open when closeOnInactive is false and focus is lost 3. Verify popups close automatically when closeOnInactive is true and focus is lost via activeChanged, grab timeout, or ungrab 4. Test switching popups sharing the same popup window keeps the new owner open 5. Verify stale close calls from previous popup owners do not close the new owner 6. Test DockPositioner availableGeometry updates when moving panel across screens 7. Verify availableGeometryChanged signal fires on screen change and available geometry change 8. Run QML tests via ctest to validate popup lifecycle policies feat: 添加弹窗关闭策略和任务栏屏幕跟踪 1. 为 PanelPopup 添加 closeOnInactive 属性,允许弹窗在窗口失活时保持打开 2. 将内部所有自动关闭路径(焦点丢失、抓取超时、取消抓取、交互结束)置于 closeOnInactive 控制之下 3. 在 DockPositioner 中跟踪面板 QWindow 所在屏幕,并暴露带变更通知 的 availableGeometry 4. 在 screenChanged 时重新连接屏幕信号,以跟随跨屏移动的面板 5. 修复弹窗 parent 回退值从 undefined 改为 null,使 QML 绑定语义更清晰 6. 新增 PanelPopup 的 QML 生命周期冒烟测试,覆盖打开关闭、共享窗口切换和 焦点丢失场景 7. 将 qmltestrunner 接入 CTest,使用离屏平台进行无头弹窗策略测试 Log: 新增面板弹窗 closeOnInactive 选项和 DockPositioner 的 availableGeometry 跟踪 Influence: 1. 测试重复点击时的弹窗打开关闭切换行为 2. 验证 closeOnInactive 为 false 时焦点丢失后弹窗保持打开 3. 验证 closeOnInactive 为 true 时通过 activeChanged、抓取超时或取消抓取 导致焦点丢失后弹窗自动关闭 4. 测试共享同一弹窗窗口的弹窗切换时新所有者保持打开 5. 验证旧弹窗所有者的过期关闭调用不会关闭新所有者 6. 测试面板跨屏移动时 DockPositioner 的 availableGeometry 更新 7. 验证屏幕切换和可用几何变化时触发 availableGeometryChanged 信号 8. 通过 ctest 运行 QML 测试以验证弹窗生命周期策略 PMS: TASK-397247
affff9b to
91315e1
Compare
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ❌评价: 存在逻辑缺陷 ❌ 不通过 潜在问题: 建议: ['建议在构造函数中使用 lambda 配合 rootObjectChanged 信号实现延迟连接, 当窗口未就绪时在 rootObjectChanged 触发后重试连接,确保屏幕跟踪在任何时候都能正常初始化。'] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: ['建议为 setScreen() 和 availableGeometry() 方法添加简短的函数注释, 说明方法的目的和调用时机。'] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例// dockpositioner.cpp 构造函数中改进屏幕跟踪初始化: // 使用 lambda 配合 rootObjectChanged 信号,确保窗口未就绪时延迟连接
DockPositioner::DockPositioner(DPanel *panel, QObject *parent)
: QObject(parent), m_panel(panel)
{
// ... 其他初始化代码 ...
Q_ASSERT(m_panel);
// 使用 lambda 封装屏幕跟踪初始化逻辑
auto setupScreenTracking = [this]() {
if (auto window = m_panel->window()) {
connect(window, &QWindow::screenChanged, this, &DockPositioner::setScreen);
setScreen(window->screen());
}
};
setupScreenTracking();
// 当窗口尚未就绪时,通过 rootObjectChanged 信号延迟重试
connect(m_panel, &DPanel::rootObjectChanged, this, setupScreenTracking);
connect(m_panel, SIGNAL(positionChanged(Position)), this, SLOT(update()));
connect(m_panel, SIGNAL(geometryChanged(QRect)), this, SLOT(update()));
// ...
}本报告由 AI 代码审查工具自动生成 |
|
TAG Bot New tag: 2.0.61 |
Log: Added closeOnInactive option for panel popups and availableGeometry tracking in DockPositioner
Influence:
feat: 添加弹窗关闭策略和任务栏屏幕跟踪
Log: 新增面板弹窗 closeOnInactive 选项和 DockPositioner 的
availableGeometry 跟踪
Influence:
PMS: TASK-397247
Summary by Sourcery
Add configurable popup inactivity behavior and track the available geometry of the panel’s current screen.
New Features:
Bug Fixes:
Enhancements:
CI:
Tests: