Skip to content

Conversation

@deepin-ci-robot
Copy link
Contributor

@deepin-ci-robot deepin-ci-robot commented May 13, 2025

Synchronize source files from linuxdeepin/dde-session-shell.

Source-pull-request: linuxdeepin/dde-session-shell#6

Summary by Sourcery

Sync changes from linuxdeepin/dde-session-shell: refactor and unify popup handling in LockContent and ControlWidget, replace custom tip and layout popups with PopupWindow, and improve event filtering and keyboard grabbing behaviors.

New Features:

  • Add requestShowTrayModule signal in ControlWidget and corresponding showTrayPopup slot in LockContent for unified popup display

Bug Fixes:

  • Re-grab keyboard focus after tray popup is hidden under X11 (BUG-134087)
  • Automatically hide tray popups when session status changes out of password mode (BUG-256133)

Enhancements:

  • Extract tray and keyboard layout popups into a single showTrayPopup method in LockContent and emit a requestShowTrayModule signal from ControlWidget
  • Replace TipsWidget and DArrowRectangle usages with unified PopupWindow for tray modules and keyboard layouts
  • Initialize widget pointers with default null values and remove obsolete module loader includes
  • Install event filter in LockContent constructor and consolidate popup event filter logic

@sourcery-ai
Copy link

sourcery-ai bot commented May 13, 2025

Reviewer's Guide

This PR synchronizes upstream changes by refactoring tray and keyboard-layout popups into a unified PopupWindow flow, cleaning up widget constructors and member initializations, and updating signal-slot wiring to streamline event handling and address keyboard-grab bugs.

File-Level Changes

Change Details Files
Extracted and centralized tray/plugin popup handling into a new showTrayPopup method
  • Introduced LockContent::showTrayPopup with PopupWindow setup and reuse logic
  • Removed inlined popup code from showModule in favor of showTrayPopup
  • Retained event-filter install/remove loop for child widgets in the new method
  • Moved keyboard-grab fix into popup hide handler connected to visibleChanged
src/session-widgets/lockcontent.cpp
src/session-widgets/lockcontent.h
Replaced TipsWidget and custom DArrowRectangle popups with PopupWindow usage
  • Swapped m_tipsWidget type from TipsWidget/DArrowRectangle to PopupWindow in ControlWidget
  • Removed DArrowRectangle configuration and eventFilter code
  • Adjusted positioning calls to use mapTo(topLevelWidget…) and show(QPoint)
  • Updated module and keyboard-layout tooltips to emit requestShowTrayModule
src/widgets/controlwidget.cpp
src/widgets/controlwidget.h
Cleaned up constructor initializer lists and default member values
  • Stripped out unused member initializers in LockContent ctor and added installEventFilter
  • Default-initialized all pointer and bool members to nullptr/false in lockcontent.h
  • Updated ControlWidget ctor to pass parent into m_tipsWidget and m_contextMenu
  • Removed obsolete includes (modules_loader.h, tipswidget.h) in both widgets
src/session-widgets/lockcontent.cpp
src/session-widgets/lockcontent.h
src/widgets/controlwidget.cpp
src/widgets/controlwidget.h
Refined signal-slot wiring for tray modules and keyboard layout interactions
  • Added connect for ControlWidget::requestShowTrayModule → LockContent::showTrayPopup
  • Replaced notifyKeyboardLayoutHidden lambda with keyboard-grab logic in popup hide
  • Changed setKBLayoutVisible to emit requestShowTrayModule instead of direct widget toggles
  • Removed redundant notifyKeyboardLayoutHidden handling and adjusted eventFilter hide logic
src/session-widgets/lockcontent.cpp
src/widgets/controlwidget.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Synchronize source files from linuxdeepin/dde-session-shell.

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

deepin pr auto review

关键摘要:

  • 移除了不必要的头文件 modules_loader.htipswidget.h,这有助于减少编译时间和依赖关系。
  • LockContent 类中,将 m_controlWidget 的构造函数参数从 nullptr 改为 this,确保 ControlWidget 的父对象正确设置。
  • ControlWidget 类中,移除了 m_arrowRectWidgetm_kbLayoutListView 的初始化代码,改为通过信号槽机制来控制键盘布局的显示。
  • ControlWidget 类中,将 m_tipsWidget 的类型从 TipsWidget 改为 PopupWindow,以统一弹出窗口的管理。
  • ControlWidget 类中,移除了 m_arrowRectWidget 的相关事件处理代码,改为在 LockContent 中统一处理。

是否建议立即修改:

  • 是,这些修改有助于提高代码的可维护性和可读性,同时减少了不必要的依赖和重复代码。

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We encountered an error and are unable to review this PR. We have been notified and are working to fix it.

You can try again by commenting this pull request with @sourcery-ai review, or contact us for help.

@deepin-ci-robot
Copy link
Contributor Author

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deepin-ci-robot, 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 ae77497 into master May 13, 2025
25 of 27 checks passed
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