From 9711e5d6cdf3179b8e1789506a57e2e15f51a20d Mon Sep 17 00:00:00 2001 From: Ivy233 Date: Wed, 21 Oct 2026 10:39:24 +0800 Subject: [PATCH] fix: skip missing _DEEPIN_MOVE_UPDATE client message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- xcb/utility_x11.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xcb/utility_x11.cpp b/xcb/utility_x11.cpp index b100a0de..1a6b0121 100644 --- a/xcb/utility_x11.cpp +++ b/xcb/utility_x11.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2017 - 2026 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -183,10 +183,18 @@ void Utility::updateMousePointForWindowMove(quint32 WId, bool finished/* = false // 新增:支持多屏幕的版本,接受自定义全局坐标 void Utility::updateMousePointForWindowMove(quint32 WId, const QPoint &globalPos, bool finished/* = false*/) { + // internAtom() 默认 only_if_exists=true:_DEEPIN_MOVE_UPDATE 是 deepin kwin 的私有 + // atom,窗管未创建它时查询返回 XCB_NONE,此时发送 type 为 0 的 ClientMessage, + // 会被窗管转发回客户端并触发 qtbase 的 "Unhandled client message" 告警。窗管不支持 + // 该协议时直接跳过。 + const xcb_atom_t moveUpdateType = internAtom("_DEEPIN_MOVE_UPDATE"); + if (moveUpdateType == XCB_NONE) + return; + xcb_client_message_event_t xev; xev.response_type = XCB_CLIENT_MESSAGE; - xev.type = internAtom("_DEEPIN_MOVE_UPDATE"); + xev.type = moveUpdateType; xev.window = WId; xev.format = 32; xev.data.data32[0] = globalPos.x();