Skip to content

fix: skip missing _DEEPIN_MOVE_UPDATE client message - #350

Open
Ivy233 wants to merge 1 commit into
linuxdeepin:masterfrom
Ivy233:fix/W035-unhandled-client-message
Open

Ivy233 wants to merge 1 commit into
linuxdeepin:masterfrom
Ivy233:fix/W035-unhandled-client-message

Conversation

@Ivy233

@Ivy233 Ivy233 commented Oct 21, 2026 •

Copy link
Copy Markdown

Utility::internAtom() defaults to only_if_exists=true. _DEEPIN_MOVE_UPDATE is a deepin-kwin private atom; on X servers where the window manager does not create it, the lookup returns XCB_NONE, and updateMousePointForWindowMove() sends a ClientMessage whose type field is 0. Clients that select SUBSTRUCTURE_NOTIFY on the root window (e.g. dde-shell's X11WindowMonitor) receive the malformed message, and qtbase logs a confusing "Unhandled client message" warning with an empty atom name. The window manager cannot handle the message anyway, so skip sending it when the atom does not exist.

修复 _DEEPIN_MOVE_UPDATE 缺失时的 "Unhandled client message" 告警: internAtom() 默认 only_if_exists=true,窗管未创建该私有 atom 时查询返回 XCB_NONE,原代码仍会发出 type 为 0 的 ClientMessage;dde-shell 等进程因在 root 上选择 SUBSTRUCTURE_NOTIFY 会收到并触发 qtbase 告警。atom 不存在时 直接跳过——窗管本就无法理解该消息。

PMS: TASK-394335

Summary by Sourcery

Bug Fixes:

  • Prevent malformed X11 client messages and related qtbase warnings when the private _DEEPIN_MOVE_UPDATE atom is unavailable.

Utility::internAtom() defaults to only_if_exists=true. _DEEPIN_MOVE_UPDATE
is a deepin-kwin private atom; on X servers where the window manager does
not create it, the lookup returns XCB_NONE, and updateMousePointForWindowMove()
sends a ClientMessage whose type field is 0. Clients that select
SUBSTRUCTURE_NOTIFY on the root window (e.g. dde-shell's X11WindowMonitor)
receive the malformed message, and qtbase logs a confusing
"Unhandled client message" warning with an empty atom name. The window
manager cannot handle the message anyway, so skip sending it when the
atom does not exist.

修复 _DEEPIN_MOVE_UPDATE 缺失时的 "Unhandled client message" 告警:
internAtom() 默认 only_if_exists=true,窗管未创建该私有 atom 时查询返回
XCB_NONE,原代码仍会发出 type 为 0 的 ClientMessage;dde-shell 等进程因在
root 上选择 SUBSTRUCTURE_NOTIFY 会收到并触发 qtbase 告警。atom 不存在时
直接跳过——窗管本就无法理解该消息。

PMS: TASK-394335
@sourcery-ai

sourcery-ai Bot commented Oct 21, 2026

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

Reviewer's Guide

The PR hardens window-move notifications by checking whether the optional _DEEPIN_MOVE_UPDATE atom exists and skipping the ClientMessage when it does not, preventing type-0 events from reaching X11 clients and triggering misleading qtbase warnings.

Sequence diagram for guarded window-move notification

sequenceDiagram
    participant Caller
    participant Utility
    participant XServer
    participant X11Client

    Caller->>Utility: updateMousePointForWindowMove(WId, globalPos, finished)
    Utility->>XServer: internAtom(_DEEPIN_MOVE_UPDATE)
    alt moveUpdateType == XCB_NONE
        Utility-->>Caller: return
    else atom exists
        Utility->>XServer: xcb_send_event(ClientMessage)
        XServer-->>X11Client: valid _DEEPIN_MOVE_UPDATE message
    end
Loading

File-Level Changes

Change Details Files
Avoid sending malformed X11 client messages when the private move-update atom is unavailable.
  • Resolve _DEEPIN_MOVE_UPDATE once before constructing the event.
  • Return early when atom lookup yields XCB_NONE.
  • Reuse the validated atom as the event type.
xcb/utility_x11.cpp
Update the source copyright range.
  • Extend the copyright year through 2026.
xcb/utility_x11.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

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

@Ivy233

Ivy233 commented Oct 21, 2026

Copy link
Copy Markdown
Author

因为ci更新,PR需要重新开关

@Ivy233 Ivy233 closed this Oct 21, 2026
@Ivy233 Ivy233 reopened this Oct 21, 2026
@deepin-ci-robot

Copy link
Copy Markdown
Contributor

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 100 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次提交修复了 _DEEPIN_MOVE_UPDATE 客户端消息在窗管不支持该 atom 时发送无效事件导致 qtbase 告警的问题。通过提前检查 internAtom 返回值并在 XCB_NONE 时提前返回,逻辑正确、注释清晰、无安全风险。四维度全部通过,无安全漏洞。

🔍 详细分析

1. 语法逻辑 ✅

评价: 语法正确,逻辑清晰 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: []


2. 代码质量 ✅

评价: 代码结构清晰,注释完整 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: []


3. 代码性能 ✅

评价: 性能良好,资源使用合理 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: []


4. 代码安全 🔒

评价: 存在0个安全漏洞 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: []


💡 改进建议代码示例

// 当前修复已完整,无需额外改进。 // internAtom("_DEEPIN_MOVE_UPDATE") 返回 XCB_NONE 时提前返回, // 避免发送无效 ClientMessage,逻辑正确且注释充分。

本报告由 AI 代码审查工具自动生成

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

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