feat(personalization): implement new protocol split for treeland-protocols 0.6.0 - #1384
feat(personalization): implement new protocol split for treeland-protocols 0.6.0#1384deepin-wm wants to merge 2 commits into
Conversation
Add decoration, appearance, and appearance-manager protocol implementations for treeland-protocols 0.6.0. Extract Shadow/Border structs to a shared header. Old personalization-manager-v1 is kept for backward compatibility during the transition period. 为 treeland-protocols 0.6.0 新增 decoration、appearance 和 appearance-manager 三个协议实现,提取 Shadow/Border 结构体到共享 头文件,旧 personalization-manager-v1 协议保留以支持过渡期兼容。 Log: 实现新协议拆分,适配 treeland-protocols 0.6.0 Influence: 新增 3 个协议实现与旧协议共存,不影响现有功能。
|
Skipping CI for Draft Pull Request. |
|
[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 |
Reviewer's GuideThis PR adapts personalization to treeland-protocols 0.6.0 by adding decoration, appearance, and privileged appearance-manager Wayland globals, wiring them into Helper, and preserving the legacy manager. Appearance values are pushed from the current user configuration and mutations flow back through DConfig, while decoration contexts validate surface ownership and apply supported per-window overrides. Sequence diagram for pushed appearance settingssequenceDiagram
participant Client
participant AppearanceInterfaceV1
participant Helper
participant Config as TreelandUserConfig
Client->>AppearanceInterfaceV1: bind_resource
AppearanceInterfaceV1->>Helper: config()
Helper-->>AppearanceInterfaceV1: current configuration
AppearanceInterfaceV1->>Client: send_cursor_theme
AppearanceInterfaceV1->>Client: send_font
AppearanceInterfaceV1->>Client: send_accent_color
AppearanceInterfaceV1->>Client: send_window_opacity
AppearanceInterfaceV1->>Client: send_color_scheme
AppearanceInterfaceV1->>Client: send_corner_radius
Config-->>AppearanceInterfaceV1: windowThemeTypeChanged
AppearanceInterfaceV1->>Client: send_color_scheme
Config-->>AppearanceInterfaceV1: activeColorChanged
AppearanceInterfaceV1->>Client: send_accent_color
Sequence diagram for privileged appearance updatessequenceDiagram
participant SettingsClient
participant AppearanceManagerInterfaceV1
participant Config as TreelandUserConfig
participant Helper
participant AppearanceInterfaceV1
participant BoundClients
SettingsClient->>AppearanceManagerInterfaceV1: set_color_scheme
AppearanceManagerInterfaceV1->>Config: setWindowThemeType
AppearanceManagerInterfaceV1->>Helper: syncPaletteTypeWithWindowThemeType
Config-->>AppearanceInterfaceV1: windowThemeTypeChanged
AppearanceInterfaceV1->>BoundClients: send_color_scheme
SettingsClient->>AppearanceManagerInterfaceV1: set_accent_color
AppearanceManagerInterfaceV1->>Config: setActiveColor
Config-->>AppearanceInterfaceV1: activeColorChanged
AppearanceInterfaceV1->>BoundClients: send_accent_color
Sequence diagram for per-surface decoration context creationsequenceDiagram
participant Client
participant DecorationManagerInterfaceV1
participant DecorationContextV1
participant Helper
participant SurfaceWrapper
Client->>DecorationManagerInterfaceV1: get_decoration_context
DecorationManagerInterfaceV1->>DecorationManagerInterfaceV1: validate surface ownership
DecorationManagerInterfaceV1->>DecorationContextV1: create context
DecorationManagerInterfaceV1-->>Helper: contextCreated
Helper->>SurfaceWrapper: setRadius
Helper->>SurfaceWrapper: setNoTitleBar
Client->>DecorationContextV1: set_corner_radius
DecorationContextV1-->>Helper: cornerRadiusChanged
Helper->>SurfaceWrapper: setRadius
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…tructor test_protocol_personalization attaches AppearanceInterfaceV1 to a bare WServer with no Helper singleton, so Helper::instance() is nullptr in the constructor. The constructor passed that nullptr to QObject::connect (triggering 'invalid nullptr parameter') and then dereferenced it via setupConfigConnections()->Helper::instance()->config(), causing a SIGSEGV at address 0x28 (nullptr offset). Guard the constructor body: only wire up the configChanged connection and the initial setupConfigConnections() when Helper::instance() is valid. In production Helper is always constructed before the interface is attached in Helper::init(), so behavior is unchanged; unit tests no longer crash. Log: 修复 AppearanceInterfaceV1 构造函数未判空 Helper 导致测试 SIGSEGV Influence: 仅影响单元测试构造路径,生产环境行为不变
|
TAG Bot New tag: 0.10.0 |
Summary
Adapt the personalization module to treeland-protocols 0.6.0 breaking changes by implementing 3 new protocol server implementations while keeping the old
personalization-manager-v1for backward compatibility during the transition period.New protocol implementations
treeland_decoration_unstable_v1→decorationmanagerinterfacev1.{h,cpp}get_decoration_contexttreeland_appearance_unstable_v1→appearanceinterfacev1.{h,cpp}treeland_appearance_manager_unstable_v1→appearancemanagerinterfacev1.{h,cpp}set_*requests writing to DConfigHelper::syncPaletteTypeWithWindowThemeType()for color scheme changesShared types
ShadowandBorderstructs extracted tosrc/common/windowdecorations.h, shared by old and new protocol implementations.Key design decisions
PersonalizationManagerInterfaceV1kept alongside new protocols; old code has zero changes (only struct extraction).get_*requests removed; values pushed on bind and on change.Files changed
src/common/windowdecorations.hsrc/modules/personalization/decorationmanagerinterfacev1.{h,cpp}src/modules/personalization/appearanceinterfacev1.{h,cpp}src/modules/personalization/appearancemanagerinterfacev1.{h,cpp}src/modules/personalization/CMakeLists.txtsrc/modules/personalization/personalizationmanagerinterfacev1.hsrc/seat/helper.{h,cpp}src/CMakeLists.txttests/test_protocol_personalization/main.cppMultica issue: WM-444
Summary by Sourcery
Implement the treeland-protocols 0.6.0 personalization split while maintaining backward compatibility with the existing protocol.
New Features:
Enhancements:
Build:
Tests: