fix: migrate treeland output protocol v1 to v2 - #1729
Conversation
1. Update find_package to require TreelandProtocols 0.6 in both CMakeLists 2. Migrate treelandoutputwatcher to treeland_output_manager_v2 with wl_output 3. Migrate treelandbrightness from color_control_v1 to picture_control_v2 4. Handle null primary_output with early return for v2 allow-null Log: Migrated treeland output protocol consumers from v1 to v2 Influence: 1. Test primary screen switching in multi-monitor setups 2. Verify OSD brightness display reflects correct values 3. Test dde-shell does not crash when no output is available fix: 迁移 treeland output 协议 v1 到 v2 1. 更新两处 CMakeLists 的 find_package 要求 TreelandProtocols 0.6 2. 迁移 treelandoutputwatcher 至 treeland_output_manager_v2 使用 wl_output 3. 迁移 treelandbrightness 从 color_control_v1 到 picture_control_v2 4. 处理 null primary_output 提前返回以适配 v2 allow-null 语义 Log: 迁移 treeland output 协议消费者从 v1 到 v2 Influence: 1. 测试多屏环境下主屏切换功能 2. 验证 OSD 亮度显示反映正确数值 3. 测试无输出设备时 dde-shell 不崩溃 Ref: DDE-232
|
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 GuideUpdates both Treeland output protocol consumers to unstable v2, including build-time protocol generation and generated Qt Wayland bindings. The shell now resolves nullable wl_output events back to QScreen objects, while the brightness OSD uses the renamed v2 picture-control interface; application logic is otherwise preserved, with added null safety for missing primary outputs. Sequence diagram for v2 primary output resolutionsequenceDiagram
participant Compositor
participant TreelandOutputWatcher
participant QGuiApplication
participant QScreen
participant QWindowSystemInterface
Compositor->>TreelandOutputWatcher: treeland_output_manager_v2_primary_output(output)
alt output is null
TreelandOutputWatcher-->>Compositor: return
else output is valid
TreelandOutputWatcher->>QGuiApplication: screens()
loop each screen
TreelandOutputWatcher->>QScreen: nativeInterface<QNativeInterface::QWaylandScreen>()
TreelandOutputWatcher->>QScreen: output()
alt output matches
TreelandOutputWatcher->>QWindowSystemInterface: handlePrimaryScreenChanged(screen->handle())
TreelandOutputWatcher-->>Compositor: return
end
end
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
TAG Bot New tag: 2.0.54 |
Treeland output 协议 v2 适配
将 dde-shell 中两处 treeland output v1 协议消费者迁移到 v2(纯协议消费者迁移,无逻辑变更)。
改动文件(6 个)
shell/CMakeLists.txtfind_package(TreelandProtocols 0.6 REQUIRED);XML 引用 →treeland-output-manager-unstable-v2.xmlshell/treelandoutputwatcher.hqwayland-treeland-output-manager-unstable-v2.h;基类 →treeland_output_manager_v2;override 签名QString→struct ::wl_output*;新增struct wl_output;前置声明shell/treelandoutputwatcher.cpp…-unstable-v2-client-protocol.h;接口版本 →treeland_output_manager_v2_interface.version;primary_output改为 null 早返回 + 遍历qApp->screens()通过QNativeInterface::QWaylandScreen::output()反查 QScreenpanels/notification/osd/brightness/CMakeLists.txtNO_INCLUDE_CORE_ONLY)panels/notification/osd/brightness/treelandbrightness.hcolor_control_v1→picture_control_v2;treeland_output_manager_v1→v2;本地类名TreelandColorControl保留不变panels/notification/osd/brightness/treelandbrightness.cppget_color_control→get_picture_control;接口版本更新关键说明
#include <QNativeInterface>:Qt6 不为该命名空间生成转发头文件,QWaylandScreen通过<QScreen>传递性引入primary_output事件allow-null="true",实现中 null 早返回qApp->primaryScreen()->name()在primaryScreen()返回 null 时会崩溃;v2 版本增加了 null 防护Ref: DDE-232
Summary by Sourcery
Migrate Treeland output consumers to protocol v2 while preserving existing output and brightness behavior.
Bug Fixes:
Enhancements:
Build: