feat: add prelaunch splash v2 protocol support#740
Conversation
|
Skipping CI for Draft Pull Request. |
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.
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 接入请求/创建流程,并实现关闭清理入口。 |
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. 验证离屏渲染环境设置正确
Updated copyright year from 2025 to 2025-2026 across multiple files Reorganized include statements for better code organization Improved code formatting and alignment for better readability Split single-line method declarations into multi-line format for consistency Adjusted signal parameter alignment for visual clarity No functional changes were made in this commit, only code style improvements chore: 更新预启动闪屏模块代码格式 将多个文件的版权年份从2025更新为2025-2026 重新组织包含语句以改善代码结构 改进代码格式和对齐以提高可读性 将单行方法声明拆分为多行格式以保持一致性 调整信号参数对齐以获得更好的视觉效果 本次提交没有功能性更改,仅进行代码样式改进
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wineee, 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 |
|
Copyright年份检查工具还要,这条ci失败本次忽略。 |
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: