Skip to content

Conversation

@yixinshark
Copy link
Contributor

1.use popupWindow for tray tips displaying
2.show tray plugin popup in lockContent

Log: as title
Pms: BUG-314221,BUG-312899

deepin-ci-robot added a commit to linuxdeepin/dde-session-shell-snipe that referenced this pull request May 13, 2025
Synchronize source files from linuxdeepin/dde-session-shell.

Source-pull-request: linuxdeepin/dde-session-shell#6
@yixinshark yixinshark force-pushed the fix-trayTipsAndPopupDisplay branch from cbcf76d to d3ab584 Compare May 13, 2025 02:45
deepin-ci-robot added a commit to linuxdeepin/dde-session-shell-snipe that referenced this pull request May 13, 2025
Synchronize source files from linuxdeepin/dde-session-shell.

Source-pull-request: linuxdeepin/dde-session-shell#6
@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. 移除未使用的头文件

    • modules_loader.hlockcontent.cppcontrolwidget.cpp 中被移除,但未在 lockcontent.hcontrolwidget.h 中移除。建议在头文件中也移除这些未使用的头文件。
  2. 成员变量初始化

    • lockcontent.hcontrolwidget.h 中,部分成员变量被初始化为 nullptrfalse,这是好的做法,可以避免未初始化的指针或布尔值带来的潜在问题。
  3. 代码重构

    • showTrayPopup 函数在 lockcontent.cpp 中被重构,增加了 callShowForce 参数,并在 controlwidget.cpp 中相应地修改了调用。这种重构提高了代码的可读性和可维护性。
  4. 事件过滤器的使用

    • eventFilter 函数中,移除了对 m_arrowRectWidget 的隐藏事件处理,改为通过信号槽机制来控制 m_popWin 的显示和隐藏。这种改动使得事件处理更加清晰和模块化。
  5. 代码注释

    • showTrayPopup 函数中添加了详细的注释,解释了函数的用途和关键步骤,这有助于其他开发者理解代码逻辑。
  6. 潜在的内存泄漏

    • showTrayPopup 函数中,如果 m_popWin 已经存在,但没有内容或内容不是 contentWidget,则应该先删除旧的内容,再设置新的内容。这样可以避免潜在的内存泄漏。
  7. 代码风格

    • showTrayPopup 函数中,m_popWin->move(point.x(), point.y()); 这行代码应该放在 m_popWin->show(point); 之前,以确保窗口移动到正确的位置后再显示。
  8. 重复代码

    • eventFilter 函数中,对 m_currentTray 和其子对象的事件过滤逻辑重复了多次,可以考虑提取成一个公共函数来减少代码重复。
  9. 未处理的异常

    • showTrayPopup 函数中,没有对 mapFromGlobalmapTo 的返回值进行错误处理,如果这些函数失败,可能会导致程序异常。建议添加相应的错误处理逻辑。
  10. 信号槽连接

    • controlwidget.cpp 中,requestShowTips 信号的连接中,如果 trayModule->itemTipsWidget() 为空或 content()->isVisible() 为真,则不显示 m_tipsWidget。这种逻辑可能会导致 m_tipsWidget 被意外隐藏,建议确认这种逻辑是否符合预期。

总体来说,代码重构和优化使得代码更加清晰和易于维护,但也需要注意潜在的内存泄漏和异常处理问题。

1.use popupWindow for tray tips displaying
2.show tray plugin popup in lockContent

Log: as title
Pms: BUG-314221,BUG-312899
@yixinshark yixinshark force-pushed the fix-trayTipsAndPopupDisplay branch from d3ab584 to 6567620 Compare May 13, 2025 02:46
deepin-ci-robot added a commit to linuxdeepin/dde-session-shell-snipe that referenced this pull request May 13, 2025
Synchronize source files from linuxdeepin/dde-session-shell.

Source-pull-request: linuxdeepin/dde-session-shell#6
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fly602, yixinshark

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@yixinshark yixinshark merged commit 2ffc900 into linuxdeepin:master May 13, 2025
14 of 15 checks passed
yixinshark pushed a commit to linuxdeepin/dde-session-shell-snipe that referenced this pull request May 13, 2025
Synchronize source files from linuxdeepin/dde-session-shell.

Source-pull-request: linuxdeepin/dde-session-shell#6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants