Skip to content

fix: fix AlertToolTip parent causing drag issues#596

Merged
18202781743 merged 1 commit intolinuxdeepin:masterfrom
18202781743:master
Mar 31, 2026
Merged

fix: fix AlertToolTip parent causing drag issues#596
18202781743 merged 1 commit intolinuxdeepin:masterfrom
18202781743:master

Conversation

@18202781743
Copy link
Copy Markdown
Contributor

@18202781743 18202781743 commented Mar 31, 2026

Fixed an issue where AlertToolTip's parent was set to Overlay.overlay
when shown, which could interfere with window dragging functionality.
The tooltip's children were being displayed in the overlay layer,
potentially blocking mouse events on the window title bar. Now the
parent is conditionally set to the target when not shown, and only to
Overlay.overlay when actually visible.

Log: Fixed an issue where tooltips could interfere with window dragging

Influence:

  1. Test that AlertToolTip displays correctly when triggered
  2. Verify that window title bar remains fully draggable when tooltip is
    not shown
  3. Check that tooltip positioning and animations work properly
  4. Ensure tooltip doesn't block mouse events on underlying UI elements
  5. Test tooltip behavior during window drag operations

fix: 修复AlertToolTip父级设置导致窗口拖动问题

修复了AlertToolTip在显示时父级设置为Overlay.overlay导致可能干扰窗口
拖动功能的问题。工具提示的子元素在覆盖层显示,可能会阻挡窗口标题栏上
的鼠标事件。现在父级在未显示时条件性地设置为目标元素,仅在可见时设置
为Overlay.overlay。

Log: 修复了工具提示可能干扰窗口拖动的问题

Influence:

  1. 测试AlertToolTip在触发时是否正确显示
  2. 验证工具提示未显示时窗口标题栏是否完全可拖动
  3. 检查工具提示定位和动画是否正常工作
  4. 确保工具提示不会阻挡底层UI元素的鼠标事件
  5. 测试窗口拖动操作期间的工具提示行为

PMS: BUG-354939

Summary by Sourcery

Bug Fixes:

  • Ensure AlertToolTip is only parented to the overlay when shown so it no longer blocks mouse events or window dragging when hidden.

Fixed an issue where AlertToolTip's parent was set to Overlay.overlay
when shown, which could interfere with window dragging functionality.
The tooltip's children were being displayed in the overlay layer,
potentially blocking mouse events on the window title bar. Now the
parent is conditionally set to the target when not shown, and only to
Overlay.overlay when actually visible.

Log: Fixed an issue where tooltips could interfere with window dragging

Influence:
1. Test that AlertToolTip displays correctly when triggered
2. Verify that window title bar remains fully draggable when tooltip is
not shown
3. Check that tooltip positioning and animations work properly
4. Ensure tooltip doesn't block mouse events on underlying UI elements
5. Test tooltip behavior during window drag operations

fix: 修复AlertToolTip父级设置导致窗口拖动问题

修复了AlertToolTip在显示时父级设置为Overlay.overlay导致可能干扰窗口
拖动功能的问题。工具提示的子元素在覆盖层显示,可能会阻挡窗口标题栏上
的鼠标事件。现在父级在未显示时条件性地设置为目标元素,仅在可见时设置
为Overlay.overlay。

Log: 修复了工具提示可能干扰窗口拖动的问题

Influence:
1. 测试AlertToolTip在触发时是否正确显示
2. 验证工具提示未显示时窗口标题栏是否完全可拖动
3. 检查工具提示定位和动画是否正常工作
4. 确保工具提示不会阻挡底层UI元素的鼠标事件
5. 测试窗口拖动操作期间的工具提示行为

PMS: BUG-354939
@18202781743 18202781743 requested review from BLumia and mhduiy March 31, 2026 02:30
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Mar 31, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts AlertToolTip’s parent binding so the tooltip only moves into the global overlay when visible, and otherwise remains a child of its target to avoid blocking window drag and other mouse events.

Sequence diagram for AlertToolTip visibility and parent change

sequenceDiagram
    actor User
    participant Window
    participant TargetControl
    participant AlertToolTip
    participant OverlayOverlay

    User->>TargetControl: Trigger_alert_condition
    TargetControl->>AlertToolTip: set_shown(true)
    AlertToolTip->>AlertToolTip: _shown = true
    AlertToolTip->>OverlayOverlay: parent = Overlay.overlay
    AlertToolTip->>OverlayOverlay: Render_tooltip_in_overlay

    User->>Window: Drag_title_bar
    Window->>Window: Drag_events_not_blocked_by_tooltip

    User->>TargetControl: Condition_clears
    TargetControl->>AlertToolTip: set_shown(false)
    AlertToolTip->>AlertToolTip: _shown = false
    AlertToolTip->>TargetControl: parent = target
    AlertToolTip->>TargetControl: Tooltip_hidden_and_no_longer_in_overlay
Loading

State diagram for AlertToolTip visibility and parent binding

stateDiagram-v2
    [*] --> Hidden

    Hidden: parent = target
    Visible: parent = Overlay.overlay

    Hidden --> Visible: _shown = true
    Visible --> Hidden: _shown = false
Loading

File-Level Changes

Change Details Files
Conditionally bind the tooltip’s parent to the overlay only when it is shown to prevent it from intercepting mouse events when hidden.
  • Replace the static parent binding with a ternary binding that uses Overlay.overlay only when the tooltip is marked as shown
  • Ensure that when the tooltip is not shown, it is re-parented to its target element instead of the overlay, keeping it out of the overlay layer
qt6/src/qml/AlertToolTip.qml

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

Copy link
Copy Markdown

@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.

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.

@deepin-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, BLumia, robertkill

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

@18202781743 18202781743 merged commit c9a9274 into linuxdeepin:master Mar 31, 2026
19 of 21 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.

4 participants