Repository navigation
fix: adapt dtkgui to Treeland protocol 0.6.0 API changes - #416
18202781743 wants to merge 2 commits into
Conversation
feat: 适配 dtkgui 到 Treeland 协议变更 1. Split personalizationwaylandclientextension into three independent protocol wrappers: treelandappearance, treelanddecoration, and treelandbackgroundeffect 2. Update dtreelandplatforminterface to use treeland_appearance_v1 read-only global, replace PersonalizationManager/AppearanceContext dependencies, setters become no-op 3. Update dtreelandplatformwindowinterface to use treeland_decoration_context_v1 + ext_background_effect_v1 surface, split dirty state management 4. Update dtreelandwindowmanagerhelper to independently detect hasBlurWindow()/hasNoTitlebar() via separate globals 5. Update plugins.cmake to reference three new protocol XML files 6. Update config.tests/treeland_test CMakeLists.txt and main.cpp 7. Update debian/control to require treeland-protocols >= 0.7.0 8. Add window blur area support in dplatformhandle.cpp 1. 将 personalizationwaylandclientextension 拆分为三个独立的协议封装: treelandappearance、treelanddecoration、treelandbackgroundeffect 2. 更新 dtreelandplatforminterface 使用 treeland_appearance_v1 只读 global,移除 PersonalizationManager/AppearanceContext 依赖,setter 改为 no-op 3. 更新 dtreelandplatformwindowinterface 使用 treeland_decoration_context_v1 + ext_background_effect_v1 surface, 拆分 dirty state 管理 4. 更新 dtreelandwindowmanagerhelper 各 global 独立检测 hasBlurWindow()/hasNoTitlebar() 5. 更新 plugins.cmake 引用三个新协议 XML 文件 6. 更新 config.tests/treeland_test 的 CMakeLists.txt 和 main.cpp 7. 更新 debian/control 要求 treeland-protocols >= 0.7.0 8. 在 dplatformhandle.cpp 中添加窗口模糊区域支持 Log: Treeland 协议从单一 personalization-manager 拆分为 appearance、decoration、background-effect 三个独立协议,dtkgui 需要适配新的协议接口 Influence: dtkgui Treeland 平台插件,影响窗口装饰、模糊效果和外观属性的 Wayland 适配
fix: 对齐 treeland-protocols 0.6.0 协议 API 1. Fix accent_color override signature to 4 params (r, g, b, a) to match treeland_appearance_v1 base class generated by 0.6.0 protocol 2. Qualify titlebar_mode enum references with TreelandDecorationContext:: scope in dtreelandplatformwindowinterface.cpp 3. Update debian/control treeland-protocols dependency from >= 0.7.0 to >= 0.6.0 (0.7.0 does not exist upstream) 1. 修复 accent_color 重写签名为 4 参数 (r, g, b, a),匹配 0.6.0 协议 生成的 treeland_appearance_v1 基类签名 2. 在 dtreelandplatformwindowinterface.cpp 中为 titlebar_mode 枚举引用 添加 TreelandDecorationContext:: 作用域限定 3. 更新 debian/control 中 treeland-protocols 依赖从 >= 0.7.0 改为 >= 0.6.0(上游不存在 0.7.0 版本) Log: treeland-protocols 上游最高版本为 0.6.0,代码针对不存在的 0.7.0 API 编写导致编译失败,需对齐 0.6.0 协议 API Influence: dtkgui Treeland 平台插件编译修复,影响 accent_color 签名和 titlebar_mode 枚举作用域
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743 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 |
|
Warning
|
Reviewer's GuideMigrates dtkgui from Treeland’s monolithic personalization protocol to the 0.6.0 appearance, decoration, and background-effect protocols, with read-only appearance handling, independent capability detection, updated decoration requests, and per-window blur-region support; build generation, configuration checks, and packaging requirements are updated accordingly. Sequence diagram for Treeland window blur-region applicationsequenceDiagram
participant App as Application
participant Handle as DPlatformHandle
participant Interface as DTreeLandPlatformWindowInterface
participant Helper as DTreeLandPlatformWindowHelper
participant Manager as BackgroundEffectManager
participant Surface as BackgroundEffectSurface
App->>Handle: setWindowBlurAreaByWM(window, areas)
Handle->>Interface: setWindowBlurAreas(areas)
Interface->>Helper: setWindowBlurAreas(areas)
Helper->>Helper: scheduleApply()
Helper->>Manager: hasBlurCapability()
Helper->>Surface: set_blur_region(waylandRegion)
Sequence diagram for Treeland appearance event handlingsequenceDiagram
participant Treeland as treeland_appearance_v1
participant Appearance as TreelandAppearance
participant Platform as DTreelandPlatformInterface
participant Theme as DPlatformTheme
Treeland->>Appearance: treeland_appearance_v1_font(font_name)
Appearance->>Platform: update m_fontName
Appearance->>Theme: fontNameChanged(font_name)
Treeland->>Appearance: treeland_appearance_v1_accent_color(r, g, b, a)
Appearance->>Platform: update m_activeColor
Appearance->>Theme: activeColorChanged(activeColor)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/plugins/platform/treeland/dtreelandplatformwindowinterface.cpp" line_range="161-166" />
<code_context>
return ret;
}
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
- QPointF delta = me->globalPosition() - self->m_pressPoint;
-#else
- QPointF delta = me->globalPos() - self->m_pressPoint;
-#endif
- if (delta.manhattanLength() < QGuiApplication::styleHints()->startDragDistance()) {
- return ret;
- }
</code_context>
<issue_to_address>
**issue (bug_risk):** The drag-distance guard was removed, so the first unaccepted left-button mouse move after a press starts a system window move regardless of how far the pointer moved. A click followed by a tiny pointer movement therefore initiates a window drag instead of preserving normal application mouse handling.
**Triggers:** When system move is enabled and a window receives a small mouse movement after a left-button press.
**Suggested fix:** Retain the `startDragDistance()` check using `m_pressPoint` before entering the system-move branch.
</issue_to_address>
### Comment 2
<location path="src/plugins/platform/treeland/dtreelandplatformwindowinterface.cpp" line_range="433-437" />
<code_context>
}
}
+
+ if (m_blurDirty) {
+ m_blurDirty = false;
+ if (m_blurEnabled && BackgroundEffectManager::instance()->isSupported()
+ && BackgroundEffectManager::instance()->hasBlurCapability()) {
+ if (!m_effectSurface) {
+ auto waylandWindow = dynamic_cast<QtWaylandClient::QWaylandWindow *>(window()->handle());
+ if (waylandWindow && waylandWindow->waylandSurface()) {
</code_context>
<issue_to_address>
**issue (bug_risk):** `applyPending()` clears `m_blurDirty` before checking whether the background-effect capability is available, while `blurCapabilityChanged()` only emits the window-manager-helper signal and never reschedules existing window helpers. If blur is enabled before the capability event arrives, the blur request is discarded and is never applied when the capability becomes available.
**Triggers:** When a window enables blur before the background-effect manager delivers its capabilities event.
**Suggested fix:** Keep the blur state dirty until it is applied, or connect the capability change to each helper and call `scheduleApply()` when blur becomes supported.
</issue_to_address>| #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) | ||
| QPointF delta = me->globalPosition() - self->m_pressPoint; | ||
| #else | ||
| QPointF delta = me->globalPos() - self->m_pressPoint; | ||
| #endif | ||
| if (delta.manhattanLength() < QGuiApplication::styleHints()->startDragDistance()) { |
There was a problem hiding this comment.
issue (bug_risk): The drag-distance guard was removed, so the first unaccepted left-button mouse move after a press starts a system window move regardless of how far the pointer moved. A click followed by a tiny pointer movement therefore initiates a window drag instead of preserving normal application mouse handling.
Triggers: When system move is enabled and a window receives a small mouse movement after a left-button press.
Suggested fix: Retain the startDragDistance() check using m_pressPoint before entering the system-move branch.
| if (m_blurDirty) { | ||
| m_blurDirty = false; | ||
| if (m_blurEnabled && BackgroundEffectManager::instance()->isSupported() | ||
| && BackgroundEffectManager::instance()->hasBlurCapability()) { | ||
| if (!m_effectSurface) { |
There was a problem hiding this comment.
issue (bug_risk): applyPending() clears m_blurDirty before checking whether the background-effect capability is available, while blurCapabilityChanged() only emits the window-manager-helper signal and never reschedules existing window helpers. If blur is enabled before the capability event arrives, the blur request is discarded and is never applied when the capability becomes available.
Triggers: When a window enables blur before the background-effect manager delivers its capabilities event.
Suggested fix: Keep the blur state dirty until it is applied, or connect the capability change to each helper and call scheduleApply() when blur becomes supported.
Summary
Adapt dtkgui to Treeland protocol changes — split the old
treeland-personalization-manager-v1into three independent protocol wrappers:treeland-appearance-v1,treeland-decoration-v1, andext-background-effect-v1.Changes (18 files, +686/-364)
personalizationwaylandclientextensionintotreelandappearanceclientextension,treelanddecorationclientextension, andtreelandbackgroundeffectclientextensiondtreelandplatforminterfaceto usetreeland_appearance_v1read-only global; setters become no-opdtreelandplatformwindowinterfaceto usetreeland_decoration_context_v1+ext_background_effect_v1surface; split dirty state managementdtreelandwindowmanagerhelperto independently detecthasBlurWindow()/hasNoTitlebar()via separate globalsplugins.cmaketo reference three new protocol XML filesconfig.tests/treeland_testCMakeLists.txt and main.cppdebian/controlto requiretreeland-protocols >= 0.6.0dplatformhandle.cppaccent_coloroverride signature to 4 params (r, g, b, a) and qualifytitlebar_modeenum references for treeland-protocols 0.6.0 API alignmentCommits
6bba66afeat: adapt dtkgui to Treeland protocol changesabd732ffix: align code with treeland-protocols 0.6.0 APIMultica Issue
DDE-402
Summary by Sourcery
Adapt dtkgui to Treeland protocols 0.6.0 by replacing the legacy personalization integration with separate appearance, decoration, and background-effect support.
New Features:
Bug Fixes:
Enhancements:
Build:
Tests:
Chores: