Repository navigation
feat: adapt to treeland-region-watch-unstable-v1 protocol - #1756
Conversation
|
Skipping CI for Draft Pull Request. |
Reviewer's GuideThe dock panel now tracks window overlap through Treeland’s treeland-region-watch-unstable-v1 protocol instead of the deprecated dde-shell overlap-checker interface, including updated protocol generation, lifecycle management, region updates, and output-removal handling. Sequence diagram for dock region-watch overlap trackingsequenceDiagram
participant DockPanel
participant WaylandDockHelper
participant RegionWatchManager
participant RegionWatch
participant Treeland
DockPanel->>WaylandDockHelper: hideModeChanged
WaylandDockHelper->>RegionWatchManager: get_region_watch()
RegionWatchManager-->>WaylandDockHelper: treeland_region_watch_v1
WaylandDockHelper->>RegionWatch: set_region(width, height, anchor, output)
Treeland-->>RegionWatch: treeland_region_watch_v1_enter()
RegionWatch->>WaylandDockHelper: isWindowOverlapChanged(true)
Treeland-->>RegionWatch: treeland_region_watch_v1_leave()
RegionWatch->>WaylandDockHelper: isWindowOverlapChanged(false)
Treeland-->>RegionWatch: treeland_region_watch_v1_output_removed()
RegionWatch->>WaylandDockHelper: isWindowOverlapChanged(false)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
c960283 to
d087a61
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The region watch is not reliably rebound when the dock changes screens, which can leave smart-hide overlap monitoring inactive.
1 open finding
What changed in this PR
This PR moves dock smart-hide overlap monitoring from the deprecated DDE shell interface to Treeland’s region-watch protocol.
Changes:
- Generate the new protocol client and require TreelandProtocols 0.7.0.
- Replace the overlap checker with a region watch and handle output removal.
| File | Description |
|---|---|
panels/dock/waylanddockhelper.h |
Declares the region-watch classes and event handlers. |
panels/dock/waylanddockhelper.cpp |
Creates and updates the watch and handles overlap events. |
panels/dock/CMakeLists.txt |
Adds the protocol source and raises the required version. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| connect(m_panel, &DockPanel::positionChanged, this, &WaylandDockHelper::updateRegionWatchPos); | ||
| connect(m_panel, &DockPanel::dockSizeChanged, this, &WaylandDockHelper::updateRegionWatchPos); | ||
| connect(m_panel, &DockPanel::rootObjectChanged, this, &WaylandDockHelper::updateRegionWatchPos); |
1. Add treeland-region-watch-unstable-v1.xml to CMakeLists.txt and lock TreelandProtocols to 0.7.0 2. Replace TreeLandWindowOverlapChecker with TreeLandRegionWatchManager and TreeLandRegionWatch 3. Extract shared ensureRegionWatch lambda to deduplicate region watch setup logic 4. Migrate anchor enums from treeland_window_overlap_checker to treeland_region_watch_v1 5. Replace update() with set_region() and add output_removed event handler 6. Rename updateOverlapCheckerPos to updateRegionWatchPos for consistency Influence: 1. Test dock smart-hide behavior with windows overlapping the dock area 2. Verify dock visibility when windows enter and leave the dock region 3. Test dock position changes (top, bottom, left, right) trigger correct region watch updates 4. Verify output_removed event correctly resets overlap state when display is disconnected feat: 适配 treeland-region-watch-unstable-v1 协议 1. 在 CMakeLists.txt 中新增 treeland-region-watch-unstable-v1.xml 并锁定 TreelandProtocols 至 0.7.0 2. 将 TreeLandWindowOverlapChecker 替换为 TreeLandRegionWatchManager 和 TreeLandRegionWatch 3. 提取共享的 ensureRegionWatch lambda 去重区域监听初始化逻辑 4. 将 anchor 枚举从 treeland_window_overlap_checker 迁移至 treeland_region_watch_v1 5. 将 update() 替换为 set_region() 并新增 output_removed 事件处理 6. 将 updateOverlapCheckerPos 重命名为 updateRegionWatchPos 以保持一致性 Influence: 1. 测试任务栏智能隐藏模式下窗口遮挡时的行为 2. 验证窗口进入和离开任务栏区域时任务栏可见性变化 3. 测试任务栏位置切换(上、下、左、右)时区域监听正确更新 4. 验证显示器断开时 output_removed 事件正确重置遮挡状态
d087a61 to
f687d4a
Compare
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="panels/dock/waylanddockhelper.cpp" line_range="48" />
<code_context>
- connect(m_panel, &DockPanel::rootObjectChanged, this, &WaylandDockHelper::updateOverlapCheckerPos);
+ connect(m_panel, &DockPanel::positionChanged, this, &WaylandDockHelper::updateRegionWatchPos);
+ connect(m_panel, &DockPanel::dockSizeChanged, this, &WaylandDockHelper::updateRegionWatchPos);
+ connect(m_panel, &DockPanel::rootObjectChanged, this, &WaylandDockHelper::updateRegionWatchPos);
- connect(m_ddeShellManager.get(), &TreeLandDDEShellManager::activeChanged, this, [this]() {
</code_context>
<issue_to_address>
**Overlap tracking stops after screen changes**
When the dock moves to another screen, including after its monitored output is removed, `updateRegionWatchPos()` is not called on `dockScreenChanged`, so `set_region()` keeps targeting the old output; `output_removed()` only clears overlap state, leaving SmartHide without updates on the new display.
Connect `DockPanel::dockScreenChanged` to `updateRegionWatchPos()`.
Also at `panels/dock/waylanddockhelper.cpp:291-294`.
</issue_to_address>| connect(m_panel, &DockPanel::rootObjectChanged, this, &WaylandDockHelper::updateOverlapCheckerPos); | ||
| connect(m_panel, &DockPanel::positionChanged, this, &WaylandDockHelper::updateRegionWatchPos); | ||
| connect(m_panel, &DockPanel::dockSizeChanged, this, &WaylandDockHelper::updateRegionWatchPos); | ||
| connect(m_panel, &DockPanel::rootObjectChanged, this, &WaylandDockHelper::updateRegionWatchPos); |
There was a problem hiding this comment.
🟠 High · Overlap tracking stops after screen changes
When the dock moves to another screen, including after its monitored output is removed, updateRegionWatchPos() is not called on dockScreenChanged, so set_region() keeps targeting the old output; output_removed() only clears overlap state, leaving SmartHide without updates on the new display.
Connect DockPanel::dockScreenChanged to updateRegionWatchPos().
Also at panels/dock/waylanddockhelper.cpp:291-294.
Prompt for AI agents
In `panels/dock/waylanddockhelper.cpp` at line 48:
**Overlap tracking stops after screen changes**
When the dock moves to another screen, including after its monitored output is removed, `updateRegionWatchPos()` is not called on `dockScreenChanged`, so `set_region()` keeps targeting the old output; `output_removed()` only clears overlap state, leaving SmartHide without updates on the new display.
Connect `DockPanel::dockScreenChanged` to `updateRegionWatchPos()`.
Also at `panels/dock/waylanddockhelper.cpp:291-294`.|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, 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 |
|
/forcemerge |
|
This pr force merged! (status: blocked) |

Description
Adapt the dock panel to the new
treeland-region-watch-unstable-v1protocol, replacing the deprecatedtreeland_window_overlap_checkerinterface fromdde-shell-v1.Changes
treeland-region-watch-unstable-v1.xmlprotocol source and lockTreelandProtocolsto>= 0.7.0TreeLandWindowOverlapCheckerwithTreeLandRegionWatchManager+TreeLandRegionWatch; renameupdateOverlapCheckerPos→updateRegionWatchPos; addoutput_removedevent overrideget_region_watch), extract sharedensureRegionWatchlambda, migrate anchor enums, replaceupdate()→set_region(), addoutput_removedevent handlingRelated
Summary by Sourcery
Migrate dock panel overlap monitoring to the Treeland region-watch protocol.
New Features:
Enhancements:
Build: