Conversation
set_xwindow_position_relative has been split from treeland-dde-shell-v1 into the standalone treeland-xwindow-control-unstable-v1 protocol in treeland-protocols (>=0.6.0, commit 7ba45e4). Changes: - Add TreeLandXWindowControl class (QWaylandClientExtensionTemplate + QtWayland::treeland_xwindow_control_v1) to bind the new global interface - Move setXWindowPositionRelative from TreeLandDDEShellManager to TreeLandXWindowControl; moveXEmbedWindow now calls the new interface - TreeLandDDEShellManager is retained for get_window_overlap_checker - Add treeland-xwindow-control-unstable-v1.xml to qt_generate_wayland_protocol_client_sources in panels/dock/CMakeLists.txt - Lock find_package(TreelandProtocols) to 0.6.0 - Update debian/control Build-Depends to treeland-protocols (>= 0.6.0) Issue: DDE-320
Reviewer's GuideThe dock now positions XEmbed windows through the standalone treeland_xwindow_control_v1 global, preserving the existing callback handling and DDE shell overlap-checker integration while requiring and generating the protocol from TreelandProtocols 0.6.0 or newer. Sequence diagram for XEmbed positioning via xwindow controlsequenceDiagram
participant Dock as WaylandDockHelper
participant Control as TreeLandXWindowControl
participant Wayland as treeland_xwindow_control_v1
participant Callback as wl_callback
Dock->>Control: setXWindowPositionRelative(wid, anchorSurface, dx, dy)
Control->>Control: isActive()
Control->>Wayland: set_xwindow_position_relative(wid, anchor, dx, dy)
Wayland-->>Control: wl_callback
Control-->>Dock: wl_callback
Dock->>Callback: register listener
Wayland-->>Callback: asynchronous result
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-wm The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 语法正确,逻辑清晰,空指针检查和 isActive 检查完善,无需修改 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题:
建议: 为新增的 TreeLandXWindowControl::setXWindowPositionRelative 方法添加注释,说明方法用途和返回值语义,保持与原方法注释一致 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 性能良好,方法为简单委托模式,QScopedPointer 自动管理内存,无需优化 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 无安全漏洞,安全合规 💡 改进建议代码示例// 建议在 waylanddockhelper.h 中为 setXWindowPositionRelative 添加注释
class TreeLandXWindowControl : public QWaylandClientExtensionTemplate<TreeLandXWindowControl>, public QtWayland::treeland_xwindow_control_v1
{
Q_OBJECT
public:
explicit TreeLandXWindowControl();
// Move XEmbed window to position relative to anchor surface
// Returns wl_callback* or nullptr if not active
struct ::wl_callback *setXWindowPositionRelative(uint32_t wid, struct ::wl_surface *anchor, double dx, double dy);
};本报告由 AI 代码审查工具自动生成 |
|
TAG Bot New tag: 2.0.55 |
|
TAG Bot New tag: 2.0.56 |
背景
treeland-xwindow-control-unstable-v1协议(含set_xwindow_position_relative接口)已从treeland-dde-shell-v1中独立拆分到treeland-protocols(>=0.6.0,commit7ba45e4及之后)。原treeland_dde_shell_manager_v1中的set_xwindow_position_relative已标记为 deprecated。dde-shell dock 模块需要适配,将 XEmbed 窗口相对定位调用迁移到新的
treeland_xwindow_control_v1global 接口。改动内容
panels/dock/waylanddockhelper.h#include "qwayland-treeland-xwindow-control-unstable-v1.h"TreeLandXWindowControl类,继承QWaylandClientExtensionTemplate<TreeLandXWindowControl>和QtWayland::treeland_xwindow_control_v1,提供setXWindowPositionRelative方法TreeLandDDEShellManager中移除setXWindowPositionRelative方法声明(该类保留,仍用于get_window_overlap_checker)WaylandDockHelper新增成员QScopedPointer<TreeLandXWindowControl> m_xwindowControlpanels/dock/waylanddockhelper.cppqwayland-treeland-xwindow-control-unstable-v1.h和wayland-treeland-xwindow-control-unstable-v1-client-protocol.h两个 includeTreeLandXWindowControl构造函数和setXWindowPositionRelative(检查isActive(),转调新接口)TreeLandDDEShellManager::setXWindowPositionRelative实现m_xwindowControl.reset(new TreeLandXWindowControl())moveXEmbedWindow中 isActive 检查和setXWindowPositionRelative调用从m_ddeShellManager改为m_xwindowControlm_ddeShellManager的activeChanged信号连接和 overlap checker 逻辑保持不动panels/dock/CMakeLists.txtfind_package(TreelandProtocols REQUIRED)→find_package(TreelandProtocols 0.6.0 REQUIRED)qt_generate_wayland_protocol_client_sources的 FILES 列表追加treeland-xwindow-control-unstable-v1.xmldebian/controltreeland-protocols (>> 0.5.9)→treeland-protocols (>= 0.6.0)注意事项
set_xwindow_position_relative的请求签名和回调语义与旧接口完全一致,moveXEmbedWindow中的wl_callbacklistener 逻辑无需改动TreeLandDDEShellManager类保留,仅移除setXWindowPositionRelative方法treeland-xwindow-control-unstable-v1.xml的 treeland-protocols 包(commit7ba45e4或后续发布版本)Issue: DDE-320
Summary by Sourcery
Adapt dock XEmbed positioning to the standalone Treeland XWindow Control protocol.
Enhancements:
Build:
Chores: