fix: ensure popup geometry is applied before setting plugin position - #486
Conversation
1. Added call to setGeometryFromApplyConfigure in plugin_popup_geometry 2. Popup geometry was being set after plugin position, causing layout issues 3. This ensures the popup surface has its geometry correctly updated before positioning 4. Prevents visual glitches and incorrect positioning in tray popups Log: Fixed popup geometry application order for tray popups Influence: 1. Test tray popup positioning in different screen configurations 2. Verify popup geometry matches expected dimensions after resize 3. Test with multiple monitors and different scale factors 4. Verify no visual glitches when opening/closing tray popups 5. Test popup behavior with different tray icon implementations fix: 在设置插件位置前确保应用弹出窗口几何 1. 在 plugin_popup_geometry 中添加 setGeometryFromApplyConfigure 调用 2. 弹出窗口几何信息在设置插件位置后才设置,导致布局问题 3. 这确保弹出窗口表面在定位前正确更新其几何信息 4. 防止托盘弹出窗口出现视觉故障和错误定位 Log: 修复托盘弹出窗口的几何应用顺序 Influence: 1. 测试不同屏幕配置下的托盘弹出窗口定位 2. 验证调整大小后弹出窗口几何信息符合预期尺寸 3. 在多个显示器和不同缩放比例下测试 4. 验证打开/关闭托盘弹出窗口时无视觉故障 5. 使用不同的托盘图标实现测试弹出窗口行为 PMS: BUG-370143
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnsures tray popup surfaces apply their configured geometry before setting the plugin position, fixing ordering-related layout and visual issues. Sequence diagram for updated popup geometry application ordersequenceDiagram
participant PluginPopupSurface
participant m_popup
participant plugin
PluginPopupSurface->>PluginPopupSurface: plugin_popup_geometry(x, y, width, height)
Note right of PluginPopupSurface: rect is normalized with window size
PluginPopupSurface->>PluginPopupSurface: setGeometryFromApplyConfigure(rect.topLeft, rect.size)
PluginPopupSurface->>m_popup: setPluginPos(QPoint(x, y))
PluginPopupSurface->>plugin: eventGeometry(rect)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 当前代码已正确修复问题,无需额外修改
void PluginPopupSurface::plugin_popup_geometry(int32_t x, int32_t y, int32_t width, int32_t height) {
// ... 前置计算逻辑 ...
if (rect.width() <= 0)
rect.setWidth(m_window->width());
if (rect.height() <= 0)
rect.setHeight(m_window->height());
setGeometryFromApplyConfigure(rect.topLeft(), rect.size());
m_popup->setPluginPos(QPoint(x, y));
if (plugin) {
Q_EMIT plugin->eventGeometry(rect);
}
} |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- It might be worth clarifying or asserting the relationship between the (x, y) parameters and rect.topLeft() so that setGeometryFromApplyConfigure and setPluginPos remain consistent if future changes alter how rect is computed.
- If setGeometryFromApplyConfigure has side effects such as triggering repaints or signals, consider adding a brief code comment explaining why it must precede setPluginPos to prevent future reordering from reintroducing the bug.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- It might be worth clarifying or asserting the relationship between the (x, y) parameters and rect.topLeft() so that setGeometryFromApplyConfigure and setPluginPos remain consistent if future changes alter how rect is computed.
- If setGeometryFromApplyConfigure has side effects such as triggering repaints or signals, consider adding a brief code comment explaining why it must precede setPluginPos to prevent future reordering from reintroducing the bug.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia 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 |
|
/forcemerge |
|
This pr force merged! (status: behind) |
issues
before positioning
Log: Fixed popup geometry application order for tray popups
Influence:
fix: 在设置插件位置前确保应用弹出窗口几何
Log: 修复托盘弹出窗口的几何应用顺序
Influence:
PMS: BUG-370143
Summary by Sourcery
Bug Fixes: