-
Notifications
You must be signed in to change notification settings - Fork 33
feat: add prelaunch splash v2 protocol support #740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wineee 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 |
Reviewer's GuideUpgrades the prelaunch splash Wayland protocol integration from treeland-prelaunch-splash-v1 to v2, introduces per-splash resources keyed by appId and instanceId, wires the new instanceId through to shell handling (currently unused but plumbed), and adds handling for client-initiated splash destruction and close notifications, alongside the necessary CMake/protocol wiring changes. Sequence diagram for prelaunch splash v2 creation flowsequenceDiagram
participant Client
participant ManagerV2 as PrelaunchSplashPrivate
participant SplashRes as SplashResource
participant Prelaunch as PrelaunchSplash
participant HelperObj as Helper
participant Shell as ShellHandler
participant RootContainer as RootSurfaceContainer
Client->>ManagerV2: treeland_prelaunch_splash_manager_v2_create_splash(id, app_id, instance_id, sandboxEngineName, icon_buffer)
ManagerV2->>ManagerV2: wl_resource_create(treeland_prelaunch_splash_v2_interface)
ManagerV2->>SplashRes: create SplashResource(owner=PrelaunchSplash, resource, app_id, instance_id)
ManagerV2->>Prelaunch: emit splashRequested(app_id, instance_id, qb)
Prelaunch->>HelperObj: signal splashRequested
HelperObj->>Shell: handlePrelaunchSplashRequested(appId, instanceId, iconBuffer)
Shell->>Shell: check enablePrelaunchSplash and resolver
Shell->>Shell: resolve app info (async)
Shell->>Shell: createPrelaunchSplash(appId, instanceId, iconBuffer, lastSize, darkPalette, lightPalette, splashThemeType)
Shell->>RootContainer: create prelaunch SurfaceWrapper and show splash
Sequence diagram for client-initiated prelaunch splash v2 close flowsequenceDiagram
participant Client
participant SplashRes as SplashResource
participant Prelaunch as PrelaunchSplash
participant HelperObj as Helper
participant Shell as ShellHandler
participant RootContainer as RootSurfaceContainer
Client->>SplashRes: treeland_prelaunch_splash_v2_destroy()
SplashRes->>Prelaunch: emit splashCloseRequested(m_appId, m_instanceId)
SplashRes->>SplashRes: wl_resource_destroy(handle)
SplashRes->>SplashRes: destroy_resource self-destruct
Prelaunch->>HelperObj: signal splashCloseRequested(appId, instanceId)
HelperObj->>Shell: handlePrelaunchSplashClosed(appId, instanceId)
Shell->>Shell: m_pendingPrelaunchAppIds.remove(appId)
Shell->>Shell: find matching prelaunch wrapper by appId
Shell->>RootContainer: destroyForSurface(wrapper)
Shell->>Shell: remove wrapper from m_prelaunchWrappers
Class diagram for updated prelaunch splash v2 integrationclassDiagram
class PrelaunchSplash {
+splashRequested(appId QString, instanceId QString, iconBuffer qw_buffer*)
+splashCloseRequested(appId QString, instanceId QString)
+create(server WServer*)
+destroy(server WServer*)
+global() wl_global*
+interfaceName() QByteArrayView
}
class PrelaunchSplashPrivate {
-q PrelaunchSplash*
+PrelaunchSplashPrivate(q PrelaunchSplash*)
+isGlobal() bool
+init(display wl_display*, version int)
+globalRemove()
+treeland_prelaunch_splash_manager_v2_destroy(resource Resource*)
+treeland_prelaunch_splash_manager_v2_create_splash(resource Resource*, id uint32_t, app_id QString, instance_id QString, sandboxEngineName QString, icon_buffer wl_resource*)
}
class SplashResource {
-m_owner PrelaunchSplash*
-m_appId QString
-m_instanceId QString
+SplashResource(owner PrelaunchSplash*, resource wl_resource*, appId QString, instanceId QString)
+appId() QString
+instanceId() QString
+treeland_prelaunch_splash_v2_destroy(resource Resource*)
+treeland_prelaunch_splash_v2_destroy_resource(resource Resource*)
}
class Helper {
-m_prelaunchSplash PrelaunchSplash*
-m_shellHandler ShellHandler*
+init(treeland Treeland*)
}
class ShellHandler {
-m_pendingPrelaunchAppIds QSet<QString>
-m_prelaunchWrappers QList<SurfaceWrapper*>
-m_rootSurfaceContainer RootSurfaceContainer*
+handlePrelaunchSplashRequested(appId QString, instanceId QString, iconBuffer qw_buffer*)
+createPrelaunchSplash(appId QString, instanceId QString, iconBuffer qw_buffer*, lastSize QSize, darkPalette QString, lightPalette QString, splashThemeType qlonglong)
+handlePrelaunchSplashClosed(appId QString, instanceId QString)
}
PrelaunchSplashPrivate --> PrelaunchSplash : owner
SplashResource --> PrelaunchSplash : m_owner
PrelaunchSplash --> PrelaunchSplashPrivate : has
Helper --> PrelaunchSplash : holds_pointer
Helper --> ShellHandler : holds_pointer
ShellHandler --> SurfaceWrapper : manages
ShellHandler --> RootSurfaceContainer : uses
PrelaunchSplash --> ShellHandler : signals_via_Helper
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates Treeland’s prelaunch splash support from treeland-prelaunch-splash-v1 to the v2 protocol, wiring the new instanceId parameter through the compositor and adding a close-notification path so the shell can clean up splash UI when clients request destruction.
本 PR 将 Treeland 的预启动闪屏协议从 treeland-prelaunch-splash-v1 迁移到 v2,并将新增的 instanceId 参数贯穿到合成器侧,同时增加“关闭通知”路径,以便客户端请求销毁时 shell 能清理闪屏 UI。
Changes:
- Switch protocol build/gen from v1 to v2 and require
TreelandProtocols >= 0.5.5. - Implement v2 manager + per-splash
SplashResourceand emit close requests on client destruction. - Update
Helper/ShellHandlerwiring to acceptinstanceIdand handle close notifications.
变更点:
- 将协议构建/生成从 v1 切换为 v2,并要求
TreelandProtocols >= 0.5.5。 - 实现 v2 manager 与按闪屏实例划分的
SplashResource,并在客户端销毁时发出关闭请求信号。 - 更新
Helper/ShellHandler的信号/槽连接以接收instanceId并处理关闭通知。
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/seat/helper.cpp |
Updates signal/slot wiring to pass instanceId and forward close notifications. / 更新信号连接,传递 instanceId 并转发关闭通知。 |
src/modules/prelaunch-splash/prelaunchsplash.h |
Extends signals to include instanceId and adds splashCloseRequested. / 扩展信号,加入 instanceId 并新增 splashCloseRequested。 |
src/modules/prelaunch-splash/prelaunchsplash.cpp |
Migrates to v2 protocol implementation and introduces SplashResource for per-instance lifecycle. / 迁移至 v2 协议实现,并引入 SplashResource 管理单实例生命周期。 |
src/modules/prelaunch-splash/CMakeLists.txt |
Generates/links v2 protocol code and bumps TreelandProtocols minimum version. / 生成并链接 v2 协议代码,同时提升 TreelandProtocols 最低版本要求。 |
src/core/shellhandler.h |
Updates handler APIs to accept instanceId and adds close handler declaration. / 更新处理接口以接收 instanceId,并声明关闭处理函数。 |
src/core/shellhandler.cpp |
Plumbs instanceId through request/creation flow and implements close cleanup hook. / 将 instanceId 接入请求/创建流程,并实现关闭清理入口。 |
| void treeland_prelaunch_splash_v2_destroy(Resource *resource) override | ||
| { | ||
| qCInfo(prelaunchSplash) | ||
| << "Client destroy splash appId=" << m_appId << " instanceId=" << m_instanceId; | ||
| Q_EMIT m_owner->splashCloseRequested(m_appId, m_instanceId); | ||
| wl_resource_destroy(resource->handle); | ||
| } |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SplashResource only emits splashCloseRequested from the explicit destroy request handler. If the client crashes/disconnects (or the resource is destroyed for any other reason), treeland_prelaunch_splash_v2_destroy_resource currently just deletes the object and no close notification is emitted, so the compositor UI may leak a splash wrapper. Emit the close notification from *_destroy_resource as well, and ensure it is emitted only once (e.g., emit only in *_destroy_resource, or add a guard flag to prevent double-emission when destroy calls wl_resource_destroy).
SplashResource 仅在客户端显式调用 destroy 请求时发出 splashCloseRequested。如果客户端崩溃/断开连接(或资源因其他原因被销毁),treeland_prelaunch_splash_v2_destroy_resource 目前只会 delete 对象,不会发出关闭通知,可能导致合成器侧闪屏 wrapper 泄漏。建议也在 *_destroy_resource 中发出关闭通知,并确保只发出一次(例如只在 *_destroy_resource 中发出,或增加标志位避免 destroy -> wl_resource_destroy 导致重复发出)。
| find_package(TreelandProtocols 0.5.5 REQUIRED) | ||
|
|
||
| local_qtwayland_server_protocol_treeland(libtreeland | ||
| PROTOCOL ${TREELAND_PROTOCOLS_DATA_DIR}/treeland-prelaunch-splash-v1.xml | ||
| BASENAME treeland-prelaunch-splash-v1 | ||
| PROTOCOL ${TREELAND_PROTOCOLS_DATA_DIR}/treeland-prelaunch-splash-v2.xml | ||
| BASENAME treeland-prelaunch-splash-v2 | ||
| ) |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repo has QtTest-based protocol smoke tests under tests/test_protocol_*, but there is no coverage added for the new treeland-prelaunch-splash-v2 protocol. Add a small test_protocol_prelaunch-splash that at least attaches the PrelaunchSplash interface and exercises the close-notification path (explicit destroy + client disconnect) to prevent regressions.
仓库里已有基于 QtTest 的协议冒烟测试(tests/test_protocol_*),但此次新增/升级的 treeland-prelaunch-splash-v2 协议没有对应测试覆盖。建议新增一个 test_protocol_prelaunch-splash:至少验证 PrelaunchSplash 能 attach 成功,并覆盖关闭通知路径(显式 destroy + 客户端断开)以避免回归。
1. Upgrade from treeland-prelaunch-splash-v1 to v2 protocol 2. Add instanceId parameter to support multiple instances of same app 3. Implement splash close notification when client crashes or closes early 4. Add SplashResource class to manage individual splash instances 5. Handle splash destruction requests from clients Log: Added support for treeland_prelaunch_splash_manager_v2 protocol Influence: 1. Test prelaunch splash creation with appId and instanceId parameters 2. Verify splash closes properly when client requests destruction 3. Test multiple instances of same app with different instanceIds 4. Verify cleanup when client crashes or closes unexpectedly 5. Test backward compatibility with existing splash functionality feat: 添加 prelaunch splash v2 协议支持 1. 从 treeland-prelaunch-splash-v1 升级到 v2 协议 2. 添加 instanceId 参数以支持同一应用的多个实例 3. 实现客户端崩溃或提前关闭时的闪屏关闭通知 4. 新增 SplashResource 类管理单个闪屏实例 5. 处理客户端发起的闪屏销毁请求 Log: 新增 treeland_prelaunch_splash_manager_v2 协议支持 Influence: 1. 测试使用 appId 和 instanceId 参数创建预启动闪屏 2. 验证客户端请求销毁时闪屏正确关闭 3. 测试同一应用多个实例使用不同 instanceId 的情况 4. 验证客户端崩溃或意外关闭时的清理机制 5. 测试与现有闪屏功能的向后兼容性
Added new test suite for prelaunch splash protocol functionality 1. Created new test directory test_protocol_prelaunch-splash 2. Implemented Qt test framework with CMake configuration 3. Added test cases for protocol creation and signal verification 4. Set up offscreen testing environment with 3-second timeout 5. Tests verify PrelaunchSplash protocol attachment to server 6. Validates splashRequested and splashCloseRequested signals This test ensures the prelaunch splash protocol works correctly with the Wayland server integration and provides automated validation for the splash screen functionality. Influence: 1. Run the new test executable to verify prelaunch splash protocol 2. Check test results for protocol attachment and signal functionality 3. Verify no regressions in existing protocol tests 4. Confirm test timeout behavior with 3-second limit 5. Validate offscreen rendering environment setup feat: 添加预启动闪屏协议测试 新增预启动闪屏协议功能的测试套件 1. 创建新的测试目录 test_protocol_prelaunch-splash 2. 使用 CMake 配置实现 Qt 测试框架 3. 添加协议创建和信号验证的测试用例 4. 设置离屏测试环境,超时时间为3秒 5. 测试验证 PrelaunchSplash 协议正确附加到服务器 6. 验证 splashRequested 和 splashCloseRequested 信号 该测试确保预启动闪屏协议与 Wayland 服务器集成正常工作,并为闪屏功能提供 自动化验证。 Influence: 1. 运行新的测试可执行文件验证预启动闪屏协议 2. 检查测试结果,确认协议附加和信号功能正常 3. 验证现有协议测试无回归问题 4. 确认3秒超时限制的测试行为 5. 验证离屏渲染环境设置正确
Need: linuxdeepin/dde-application-manager#332
Log: Added support for treeland_prelaunch_splash_manager_v2 protocol
Influence:
feat: 添加 prelaunch splash v2 协议支持
Log: 新增 treeland_prelaunch_splash_manager_v2 协议支持
Influence:
Summary by Sourcery
Migrate the prelaunch splash implementation to the treeland prelaunch splash v2 protocol and wire it through the compositor shell handling.
New Features:
Enhancements: