feat(output-manager): adapt to treeland-output-manager v2 protocol - #1386
feat(output-manager): adapt to treeland-output-manager v2 protocol#1386deepin-wm wants to merge 2 commits into
Conversation
|
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 GuideMigrates output-manager server and tests from the v1 protocol to treeland-protocols v2, including wl_output-based primary-output selection/events, explicit failure reporting, and enum-based picture-control commit results. The new 7-case protocol suite and primary-output test pass, while disabled/unavailable-output, brightness, unsupported, and rendering paths remain untested. Sequence diagram for v2 primary output selectionsequenceDiagram
participant Client
participant OutputManagerV2
participant RootSurfaceContainer
participant WlOutput
Client->>OutputManagerV2: bind_resource
OutputManagerV2->>RootSurfaceContainer: primaryOutput()
OutputManagerV2->>WlOutput: outputResourceForClient()
OutputManagerV2-->>Client: primary_output(wl_output or null)
Client->>OutputManagerV2: set_primary_output(wl_output)
OutputManagerV2->>WlOutput: wlr_output_from_resource()
alt output invalid, disabled, or unavailable
OutputManagerV2-->>Client: primary_output_failed(invalid_output)
else output enabled and available
OutputManagerV2->>RootSurfaceContainer: setPrimaryOutput()
end
RootSurfaceContainer-->>OutputManagerV2: primaryOutputChanged
OutputManagerV2-->>Client: primary_output(wl_output or null)
Sequence diagram for v2 picture-control commit resultssequenceDiagram
participant Client
participant PictureControlV2
participant Output
Client->>PictureControlV2: set_color_temperature(temperature)
Client->>PictureControlV2: set_brightness(brightness)
Client->>PictureControlV2: commit()
alt invalid color temperature
PictureControlV2-->>Client: result(invalid_color_temperature)
else invalid brightness
PictureControlV2-->>Client: result(invalid_brightness)
else output unavailable
PictureControlV2-->>Client: result(invalid_output)
else no pending changes
PictureControlV2-->>Client: result(success)
else valid pending changes
PictureControlV2->>Output: setOutputColor()
Output-->>PictureControlV2: success
PictureControlV2-->>Client: result(success or failed)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
e35c74a to
97bea59
Compare
97bea59 to
ee7c1ee
Compare
Migrate the output-manager module from treeland-output-manager-v1 to treeland-output-manager-unstable-v2 (treeland-protocols 0.6.0). Key breaking changes handled: - Rename interfaces: treeland_output_manager_v1 → _v2, treeland_output_color_control_v1 → treeland_output_picture_control_v2 - set_primary_output: parameter changed from string to wl_output object - primary_output event: changed from string to wl_output (null = none) - New primary_output_failed event + primary_output_error enum - result event: uint flag (1/0) → commit_result enum (values reversed) - Remove picture control error enum; out-of-range values reported via commit result instead of protocol errors - destroy moved to first request position (opcode shift) 适配 treeland-protocols 0.6.0 的 breaking 变更,将 output-manager 模块 从 v1 迁移到 v2。重命名接口,set_primary_output 改用 wl_output 对象, 新增 primary_output_failed 事件,result 事件改用 commit_result 枚举, 移除 picture control error 枚举改由 commit result 反馈。 Log: 迁移 output-manager 协议 v1 到 v2 Influence: output-manager 模块适配 treeland-protocols 0.6.0,使用旧协议 的客户端需要同步迁移到 v2 接口。
ee7c1ee to
cd03d22
Compare
|
TAG Bot New tag: 0.10.0 |
The test_case struct has an expect_disconnect field, but 6 of 7 entries in the cases[] array omitted it. With -Werror=missing-field-initializers this caused CI compilation failure. Add explicit 0 to all entries that don't expect a disconnect.
概述
适配 treeland-protocols 0.6.0 的 breaking 变更,将 output-manager 模块从 v1 迁移到 v2。
WM-441
变更内容
treeland_output_manager_v1→_v2,treeland_output_color_control_v1→treeland_output_picture_control_v2string(输出名)改为wl_output对象(non-null, enabled)string改为wl_output(null 表示无可用输出),bind 后立即发送一次commit_result枚举(success=0, failed=1, unsupported=2, invalid_output=3, invalid_color_temperature=4, invalid_brightness=5),值反转修改文件 (14 files changed, +507/-329)
源码:
src/modules/output-manager/CMakeLists.txt— XML 路径和 BASENAME 更新为 v2src/modules/output-manager/outputmanagement.h— 类名和接口版本更新src/modules/output-manager/outputmanagement.cpp— 完整 v2 实现src/seat/helper.h/src/seat/helper.cpp— 类型引用和变量命名更新测试:
tests/protocols/CMakeLists.txt— 子目录引用更新tests/protocols/treeland-output-manager-v2/— 完整 v2 测试(7 个测试用例)tests/test_protocol_primary-output/main.cpp— 类型引用更新测试结果
代码审查
已通过 Code Review 审查(87/100),并修复了审查反馈:
m_outputManagerV1→m_outputManagerV2(void)data;移除Summary by Sourcery
Migrate output management to the Treeland v2 protocol and validate its new output-object, failure-reporting, and picture-control result semantics.
New Features:
Bug Fixes:
Enhancements:
Build:
Documentation:
Tests:
Chores: