fix: xembed tray icon not updated#475
Conversation
修正treeland会话下xembed托盘图标不会更新的问题. PMS: BUG-369271 Log:
Reviewer's guide (collapsed on small PRs)Reviewer's GuideHandles XDamage notifications for XEmbed tray icons by subtracting the reported damage region before notifying the tray manager, ensuring icons update correctly in treeland sessions. Sequence diagram for handling XDamage notifications for XEmbed tray iconssequenceDiagram
participant XServer
participant FdoSelectionManager
participant Util
participant X11Connection
participant TrayManager
XServer ->> FdoSelectionManager: nativeEventFilter(eventType, message, result)
FdoSelectionManager ->> FdoSelectionManager: [responseType == m_damageEventBase + XCB_DAMAGE_NOTIFY]
FdoSelectionManager ->> FdoSelectionManager: m_damageWatches.value(damagedWId)
FdoSelectionManager ->> Util: instance()
Util -->> FdoSelectionManager: Util
FdoSelectionManager ->> X11Connection: getX11Connection()
FdoSelectionManager ->> X11Connection: xcb_damage_subtract(connection, damageId, XCB_NONE, XCB_NONE)
FdoSelectionManager ->> TrayManager: notifyIconChanged(damagedWId)
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:
- In the DAMAGE_NOTIFY branch, consider explicitly checking
m_damageWatches.contains(damagedWId)and possibly erasing the entry afterxcb_damage_subtractto avoid relying on a default 0 value and to prevent repeated subtract calls on the same damage id.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the DAMAGE_NOTIFY branch, consider explicitly checking `m_damageWatches.contains(damagedWId)` and possibly erasing the entry after `xcb_damage_subtract` to avoid relying on a default 0 value and to prevent repeated subtract calls on the same damage id.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 当前代码已为最佳实践,无需修改,此处展示上下文完整逻辑以供参考
bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message)
{
// ... 前置逻辑 ...
} else if (responseType == m_damageEventBase + XCB_DAMAGE_NOTIFY) {
const auto damagedWId = reinterpret_cast<xcb_damage_notify_event_t *>(ev)->drawable;
const xcb_damage_damage_t damageId = m_damageWatches.value(damagedWId);
if (damageId) {
xcb_damage_subtract(Util::instance()->getX11Connection(), damageId, XCB_NONE, XCB_NONE);
}
m_trayManager->notifyIconChanged(damagedWId);
}
// ... 后置逻辑 ...
} |
|
[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 |
修正treeland会话下xembed托盘图标不会更新的问题.
PMS: BUG-369271
Summary by Sourcery
Bug Fixes: