Skip to content

Conversation

@wjyrich
Copy link
Contributor

@wjyrich wjyrich commented Oct 31, 2025

  1. Added check to skip tooltip windows in DockHelper event filter
  2. This prevents tooltip windows from interfering with dock behavior
  3. Removed misleading comment from hideStateChanged signal
  4. The signal is actually emitted but was incorrectly documented

fix: 在停靠栏事件过滤器中跳过工具提示窗口

  1. 在 DockHelper 事件过滤器中添加跳过工具提示窗口的检查
  2. 防止工具提示窗口干扰停靠栏的行为
  3. 移除 hideStateChanged 信号的误导性注释
  4. 该信号实际上会被发出,但之前被错误地记录为不发出

PMS: BUG-338977

Summary by Sourcery

Prevent tooltip windows from being handled by the DockHelper event filter and correct the documentation for the hideStateChanged signal.

Bug Fixes:

  • Skip tooltip windows in the dock event filter to prevent interference with dock behavior.

Enhancements:

  • Remove misleading comment on the hideStateChanged signal in DockPanel header.

@sourcery-ai
Copy link

sourcery-ai bot commented Oct 31, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR updates the DockHelper event filter to ignore tooltip windows by checking for Qt::ToolTip flags and removes a misleading comment on the hideStateChanged signal, ensuring it’s correctly documented.

Sequence diagram for DockHelper event filter handling tooltip windows

sequenceDiagram
participant DockHelper
participant QObject
participant QWindow
participant QEvent

DockHelper->>QObject: eventFilter(watched, event)
QObject->>QWindow: get window from watched
QWindow->>DockHelper: window->flags()
DockHelper->>DockHelper: Check if flags include Qt::ToolTip
alt Tooltip window
    DockHelper-->>QObject: return false (skip event)
else Not a tooltip window
    DockHelper->>DockHelper: Continue event processing
end
Loading

Class diagram for DockPanel signal documentation update

classDiagram
class DockPanel {
  +geometryChanged(QRect geometry)
  +frontendWindowRectChanged(QRect frontendWindowRect)
  +hideStateChanged(HideState state)
  +colorThemeChanged(ColorTheme theme)
  +compositorReadyChanged()
}
Loading

File-Level Changes

Change Details Files
Skip tooltip windows in DockHelper event filter
  • Added a check for Qt::ToolTip window flag
  • Early-return false to ignore tooltip windows
panels/dock/dockhelper.cpp
Remove misleading comment on hideStateChanged signal
  • Deleted the incorrect “not emitted” comment
  • Retained the correct signal declaration
panels/dock/dockpanel.h

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

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

1. Added check to skip tooltip windows in DockHelper event filter
2. This prevents tooltip windows from interfering with dock behavior
3. Removed misleading comment from hideStateChanged signal
4. The signal is actually emitted but was incorrectly documented

fix: 在停靠栏事件过滤器中跳过工具提示窗口

1. 在 DockHelper 事件过滤器中添加跳过工具提示窗口的检查
2. 防止工具提示窗口干扰停靠栏的行为
3. 移除 hideStateChanged 信号的误导性注释
4. 该信号实际上会被发出,但之前被错误地记录为不发出

PMS: BUG-338977
@deepin-ci-robot
Copy link

deepin pr auto review

我来对这两处代码修改进行分析:

  1. dockhelper.cpp 的修改:
// 新增代码
if (window->flags().testFlags(Qt::ToolTip)) {
    return false;
}

改进建议:

  • 逻辑正确性:这个修改是合理的,通过过滤掉工具提示窗口(ToolTip)可以避免不必要的处理,提高性能。
  • 代码质量:代码简洁清晰,使用了 Qt 提供的标准方法来判断窗口类型。
  • 性能优化:这是一个很好的性能优化,避免了工具提示窗口触发后续的复杂处理逻辑。
  • 安全性:没有安全隐患。
  1. dockpanel.h 的修改:
- void hideStateChanged(HideState state); // not emitted
+ void hideStateChanged(HideState state);

改进建议:

  • 逻辑正确性:这个修改表明之前被注释掉的信号现在要正式使用了,需要确保在代码中正确地 emit 这个信号。
  • 代码质量:移除了注释,使代码更清晰。但建议在类的文档中说明这个信号的用途和触发时机。
  • 性能影响:无直接影响。
  • 安全性:无安全隐患。

总体建议:

  1. 对于 hideStateChanged 信号的使用,建议:

    • 添加详细的文档说明,说明信号的用途
    • 确保在适当的位置 emit 这个信号
    • 考虑添加单元测试来验证信号的正确触发
  2. 对于 ToolTip 的过滤:

    • 可以考虑添加日志记录,便于调试
    • 如果需要,可以扩展过滤条件,比如其他类型的临时窗口

这两处修改都是合理的改进,但建议在后续版本中补充相应的文档和测试。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, wjyrich

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

@wjyrich wjyrich merged commit 99268a8 into linuxdeepin:master Oct 31, 2025
10 of 11 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