Skip to content

fix(dock): close legacy tray tooltip on popup destruction - #1663

Open
svan71 wants to merge 1 commit into
linuxdeepin:masterfrom
svan71:agent/fix-legacy-tray-tooltip-destroy
Open

fix(dock): close legacy tray tooltip on popup destruction#1663
svan71 wants to merge 1 commit into
linuxdeepin:masterfrom
svan71:agent/fix-legacy-tray-tooltip-destroy

Conversation

@svan71

@svan71 svan71 commented Jul 12, 2026

Copy link
Copy Markdown

What changed

Close a legacy tray tooltip directly when its PluginPopup emits
aboutToDestroy.

Fixes linuxdeepin/developer-center#13616.

Root cause

Legacy tray tooltip content is owned by a plugin popup while the translucent
tooltip host is owned by dde-shell. The plugin loader correctly hides and
destroys its popup, but ShellSurfaceItemProxy.onSurfaceDestroyed is not emitted
for this teardown. TrayItemSurfacePopup therefore never closes the shared host,
leaving an empty translucent background after the text disappears.

PluginPopup.aboutToDestroy is the authoritative server-side lifecycle signal
and is emitted immediately before the popup object is deleted. Connecting the
tooltip to that signal closes the host at the correct boundary.

Impact

Legacy tray items such as Volume and Clipboard dismiss their tooltip background
correctly. Native actions such as Quick Actions and Collapse Tray are unchanged.

Validation

  • Captured the complete plugin lifecycle: pointer leave, QWidget/QWindow hide,
    popup-map removal, and PluginPopupSurface destruction all completed.
  • Confirmed the old ShellSurfaceItemProxy.onSurfaceDestroyed handler did not
    run for the plugin popup teardown.
  • Built a clean Arch package from dde-shell 2.0.50 containing only this lifecycle
    connection.
  • Live-tested Volume and Clipboard with the exact straight-down pointer exit;
    both now dismiss cleanly.
  • Rebuilt without diagnostic logging and repeated the live test successfully.

Summary by Sourcery

Bug Fixes:

  • Close legacy tray tooltip hosts in response to plugin popup about-to-destroy events so tooltip backgrounds no longer remain visible after content is dismissed.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @svan71, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: svan71

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

@deepin-ci-robot

Copy link
Copy Markdown

Hi @svan71. Thanks for your PR. 😃

@deepin-ci-robot

Copy link
Copy Markdown

Hi @svan71. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@deepin-bot

deepin-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 2.0.51
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1666

@deepin-bot

deepin-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 2.0.52
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1672

@svan71
svan71 force-pushed the agent/fix-legacy-tray-tooltip-destroy branch 2 times, most recently from 5b66a6c to 9badd94 Compare July 23, 2026 21:14
Legacy tray tooltip content is owned by a plugin popup while the
translucent tooltip host is owned by dde-shell. The plugin loader
hides and destroys its popup, but ShellSurfaceItemProxy.onSurfaceDestroyed
is not emitted for that teardown, so TrayItemSurfacePopup never closes
the shared host and leaves an empty translucent background.

Connect the tooltip to PluginPopup.aboutToDestroy so the host closes
at the correct lifecycle boundary. Fixes Volume/Clipboard tooltip
ghost backgrounds after pointer leave.
@svan71
svan71 force-pushed the agent/fix-legacy-tray-tooltip-destroy branch from 9badd94 to 24a534f Compare August 3, 2026 19:09
@svan71
svan71 marked this pull request as ready for review August 3, 2026 19:09
@svan71

svan71 commented Aug 3, 2026

Copy link
Copy Markdown
Author

Marked ready for review and rebased onto current master.

CLA / commitlint / SPDX / cppcheck are green.

Would appreciate an /ok-to-test when convenient. Happy to adjust anything.

@sourcery-ai

sourcery-ai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Connect legacy tray tooltip closure to the PluginPopup’s aboutToDestroy lifecycle signal so the shared translucent tooltip host is closed when the popup is torn down, eliminating orphaned tooltip backgrounds in the dock tray.

Sequence diagram for legacy tray tooltip closing on PluginPopup.aboutToDestroy

sequenceDiagram
    participant PluginPopup as PluginPopup_shellSurface
    participant TrayPopup as TrayItemSurfacePopup
    participant ToolTip as toolTip
    participant Host as TooltipHost

    PluginPopup->>TrayPopup: aboutToDestroy
    TrayPopup->>ToolTip: close()
    ToolTip->>Host: close()
    Host-->>PluginPopup: [tooltip host destroyed]
Loading

File-Level Changes

Change Details Files
Wire the legacy tray tooltip to close when its associated PluginPopup is about to be destroyed, instead of relying solely on ShellSurfaceItemProxy surface-destroy signals.
  • Add a Connections block bound to toolTip.shellSurface to listen for the aboutToDestroy signal from the plugin popup
  • Invoke toolTip.close() in the onAboutToDestroy handler to tear down the tooltip host at the correct lifecycle boundary
panels/dock/tray/TrayItemSurfacePopup.qml

Assessment against linked issues

Issue Objective Addressed Explanation
linuxdeepin/developer-center#13616 Ensure legacy tray tooltip hosts (TrayItemSurfacePopup) close when their associated PluginPopup is destroyed, by connecting to the shell surface's aboutToDestroy signal so the empty translucent background no longer remains.

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Legacy tray tooltip leaves empty background because popup destruction is not forwarded

2 participants