refactor: switch treeland IPC to Qt Remote Objects#96
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zccrs 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 |
9c5c73a to
38f5a23
Compare
There was a problem hiding this comment.
Pull request overview
Refactors ddm’s Treeland IPC from a generated Wayland client protocol to a Qt Remote Objects (QtRO) replica, aligning the daemon-side connector with Qt’s IPC stack and removing the build-time Wayland-client codegen dependency.
对 ddm 与 Treeland 的 IPC 进行重构:从原先生成的 Wayland client 协议切换为 Qt Remote Objects(QtRO)replica,使 daemon 侧连接器改用 Qt 的 IPC 机制,并移除构建期的 Wayland-client 协议代码生成依赖。
Changes:
- Introduces a QtRO replica definition (
treelandddmremote.rep) and switchesTreelandConnectorto call into the generatedTreelandDDMRemoteReplica. - Removes Wayland client protocol code generation/linkage from CMake and adds Qt6 RemoteObjects dependency.
- Updates distro/CI dependencies to include Qt Remote Objects (Debian Build-Depends, Arch workflow).
变更点:
- 新增 QtRO replica 定义(
treelandddmremote.rep),并让TreelandConnector通过生成的TreelandDDMRemoteReplica发起调用。 - 从 CMake 中移除 Wayland client 协议生成/链接,并新增 Qt6 RemoteObjects 依赖。
- 更新发行版/CI 依赖(Debian Build-Depends、Arch workflow)以包含 Qt Remote Objects。
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/daemon/treelandddmremote.rep |
Adds Qt Remote Objects replica interface for Treeland control methods. |
src/daemon/TreelandConnector.h |
Updates connector interface/members for QtRO + local socket usage. |
src/daemon/TreelandConnector.cpp |
Replaces Wayland IPC calls with QtRO replica acquisition and invocation logic. |
src/daemon/CMakeLists.txt |
Hooks qt_add_repc_replicas() and links Qt6::RemoteObjects; removes Wayland-generated source. |
CMakeLists.txt |
Drops Wayland client/TreelandProtocols discovery; adds Qt6 RemoteObjects requirement. |
debian/control |
Adds qt6-remoteobjects-dev to Build-Depends. |
.github/workflows/ddm-archlinux-build.yml |
Installs Qt Remote Objects dependency for Arch CI build. |
Comments suppressed due to low confidence (1)
src/daemon/TreelandConnector.h:43
- Include guards need to be closed at the end of the header (
#endif).
建议:在文件末尾补上 #endif,与文件开头的 #ifndef/#define 成对。
};
}
38f5a23 to
d13b4bb
Compare
|
已按这轮 review 收口:
之前 Copilot 提到的同步 control-socket I/O、协议版本、 |
d13b4bb to
40ceee2
Compare
|
|
||
| connect(socket, &QLocalSocket::disconnected, socket, &QLocalSocket::deleteLater); | ||
| connect(socket, &QLocalSocket::disconnected, this, [this] { | ||
| Q_EMIT disconnected(); |
There was a problem hiding this comment.
已处理:去掉了这里的 lambda,QLocalSocket::disconnected 现在直接连接到 deleteLater();同时不再额外通过 SocketServer::disconnected 做日志胶水。
| void SocketServer::login(QString user, QString password, int sessionType, QString sessionFile) { | ||
| qDebug() << "Message received from greeter: Login"; | ||
| Session session(static_cast<Session::Type>(sessionType), sessionFile); | ||
| Q_EMIT loginRequested(user, password, session); |
There was a problem hiding this comment.
不要搞这种设计呀,不能直接调用实现方的 login 方法吗?不要用这种发出信号,再在外面做一个胶水层的方式,多此一举。
There was a problem hiding this comment.
已处理:SocketServer 现在持有对应的 Display,远端 login/logout/lock/unlock/connectGreeter 请求会直接调用实现方方法,不再先发 loginRequested 等信号再由外层胶水转发。
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| class GreeterDDMRemote { | ||
| PROP(QString hostName) |
There was a problem hiding this comment.
已处理:这些属性已改成 SOURCEONLYSETTER。这样 ddm source 侧仍可更新属性值,但 replica/greeter 侧只能读取和订阅变更,语义上是远端只读。
f308bc0 to
1ca093d
Compare
|
TAG Bot New tag: 0.3.5 |
63e12e6 to
94014e1
Compare
20ccead to
1e654d8
Compare
Replace the greeter IPC bridge with Qt Remote Objects endpoints. Use DDMRemote and TreelandRemote as cross-process call contracts. 将 greeter IPC 桥接改为 Qt Remote Objects 端点。 使用 DDMRemote 和 TreelandRemote 作为跨进程调用契约。 Log: 切换 Treeland 与 DDM 的 IPC 到 Qt Remote Objects Influence: 规范远程对象和 socket 命名,影响 DDM 与 Treeland 的登录/切换通信。
1e654d8 to
c8cc950
Compare
deepin pr auto review代码审查报告总体概述这次代码更新主要涉及显示管理器(DDM)的重构,从基于Wayland原生协议通信转向使用Qt的远程对象框架(QtRO)进行进程间通信。重构旨在提高代码的可维护性和安全性。 主要变更
详细分析1. 代码质量优点:
需要改进的地方:
2. 性能考虑优点:
潜在问题:
3. 安全性优点:
需要注意的地方:
具体建议
总结这次重构整体上是积极的,提高了代码的可维护性和安全性。主要改进了进程间通信机制,简化了复杂的会话管理逻辑。建议关注性能影响,并进一步完善错误处理和安全性验证。 |
Summary
Testing