Skip to content

Commit 80098fa

Browse files
committed
refactor(ddm): switch treeland IPC to Qt Remote Objects
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 的登录/切换通信。
1 parent 7c74882 commit 80098fa

15 files changed

Lines changed: 444 additions & 616 deletions

src/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ qt_add_qml_module(libtreeland
148148
effects/tsgradiusimagenode.h
149149
$<$<OR:$<NOT:$<BOOL:${DISABLE_DDM}>>,$<BOOL:${EXT_SESSION_LOCK_V1}>>:core/lockscreen.h>
150150
$<$<OR:$<NOT:$<BOOL:${DISABLE_DDM}>>,$<BOOL:${EXT_SESSION_LOCK_V1}>>:core/lockscreen.cpp>
151+
$<$<NOT:$<BOOL:${DISABLE_DDM}>>:greeter/ddmremote.rep>
151152
$<$<NOT:$<BOOL:${DISABLE_DDM}>>:greeter/greeterproxy.cpp>
152153
$<$<NOT:$<BOOL:${DISABLE_DDM}>>:greeter/greeterproxy.h>
153154
$<$<NOT:$<BOOL:${DISABLE_DDM}>>:greeter/sessionmodel.cpp>
@@ -266,6 +267,12 @@ qt_add_qml_module(libtreeland
266267
${PROJECT_BINARY_DIR}/qt/qml/Treeland
267268
)
268269

270+
if (NOT DISABLE_DDM)
271+
qt_add_repc_replicas(libtreeland
272+
${CMAKE_CURRENT_SOURCE_DIR}/greeter/ddmremote.rep
273+
)
274+
endif()
275+
269276
qt_add_repc_sources(libtreeland
270277
modules/resource/treelandwindowtree.rep
271278
)

src/greeter/ddmremote.rep

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (C) 2026 UnionTech Software Technology Co., Ltd.
2+
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3+
4+
class DDMRemote {
5+
PROP(QString hostName SOURCEONLYSETTER)
6+
PROP(bool canPowerOff=false SOURCEONLYSETTER)
7+
PROP(bool canReboot=false SOURCEONLYSETTER)
8+
PROP(bool canSuspend=false SOURCEONLYSETTER)
9+
PROP(bool canHibernate=false SOURCEONLYSETTER)
10+
PROP(bool canHybridSleep=false SOURCEONLYSETTER)
11+
SIGNAL(loginFailed(QString user))
12+
SIGNAL(informationMessage(QString message))
13+
SIGNAL(userSessionAdded(QString user, int sessionId))
14+
SIGNAL(userSessionRemoved(QString user, int sessionId))
15+
SLOT(bool connectGreeter())
16+
SLOT(bool login(QString user, QString password, int sessionType, QString sessionFile))
17+
SLOT(bool logout(int id))
18+
SLOT(bool powerOff())
19+
SLOT(bool reboot())
20+
SLOT(bool suspend())
21+
SLOT(bool hibernate())
22+
SLOT(bool hybridSleep())
23+
};

0 commit comments

Comments
 (0)