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 Treeland shortcut management from protocol v2 to v3, replacing commit-based transactional binding with immediate per-bind registration and failure events, updating session lifecycle handling, examples, generated protocol integration, and protocol fixtures. Sequence diagram for v3 immediate and deferred shortcut bindingsequenceDiagram
participant Client
participant ShortcutManagerV3
participant ShortcutController
participant Session
Client->>ShortcutManagerV3: bind_key(name, key_sequence, flags, action)
alt active session
ShortcutManagerV3->>ShortcutController: registerKey(name, key, flags, action)
alt registration fails
ShortcutManagerV3-->>Client: bind_failure(name, error)
end
else inactive session
ShortcutManagerV3->>ShortcutManagerV3: queue bind_key
Session-->>ShortcutManagerV3: onSessionChanged()
ShortcutManagerV3->>ShortcutController: registerKey(name, key, flags, action)
alt registration fails
ShortcutManagerV3-->>Client: bind_failure(name, error)
end
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
TAG Bot New tag: 0.10.0 |
上游 treeland-protocols commit 58ca492 重组了 action 枚举,新增 14 个 action 并重新编号。PR linuxdeepin#1387 的代码仍使用旧的编号方案(v2 值 -1), 导致枚举值与协议不匹配。 - 按 v3 协议重新定义 ShortcutAction 枚举,共 46 个条目(0-45) - 移除 Quit(协议已删除),新增 Workspace7-12、Minimize、ResizeWindow、 MoveWindowToPrev/NextWorkspace、TileTop/Bottom/TopLeft/TopRight/ BottomLeft/BottomRight、ZoomIn/Out/Reset - shortcutrunner.cpp 添加 Workspace7-12 和 Minimize 的实现 - 扩展 static_assert 覆盖更多边界值 Log: 同步 action 枚举到重组后的 v3 协议 Influence: 无
上游 treeland-protocols commit 58ca492 重组了 action 枚举,新增 14 个 action 并重新编号。PR linuxdeepin#1387 的代码仍使用旧的编号方案(v2 值 -1), 导致枚举值与协议不匹配。 - 按 v3 协议重新定义 ShortcutAction 枚举,共 46 个条目(0-45) - 移除 Quit(协议已删除),新增 Workspace7-12、Minimize、ResizeWindow、 MoveWindowToPrev/NextWorkspace、TileTop/Bottom/TopLeft/TopRight/ BottomLeft/BottomRight、ZoomIn/Out/Reset - shortcutrunner.cpp 添加 Workspace7-12 和 Minimize 的实现 - 扩展 static_assert 覆盖更多边界值 Log: 同步 action 枚举到重组后的 v3 协议 Influence: 无
0113814 to
b79e960
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unsupported v3 actions are silently ignored, and renamed upserts can leave stale per-session bindings.
Review effort: Lite
Findings: 2
Open (3)
What changed in this PR
Migrates Treeland’s shortcut manager and capture protocols from v2 to v3.
Changes:
- Replaces commit-based binding with immediate binding and
bind_failure. - Updates protocol interfaces, action enums, runtime integration, and examples.
- Adds v3 protocol fixtures and desktop coverage.
| File | Description |
|---|---|
tests/test_protocol_shortcut/main.cpp |
Uses the v3 manager. |
tests/protocols/treeland-shortcut-manager-v3/treeland-shortcut-manager-v3.h |
Defines v3 test state. |
tests/protocols/treeland-shortcut-manager-v3/treeland-shortcut-manager-v3.c |
Tests v3 requests and errors. |
tests/protocols/treeland-shortcut-manager-v3/setup.cpp |
Finds the v3 server interface. |
tests/protocols/treeland-shortcut-manager-v3/README.md |
Documents v3 coverage. |
tests/protocols/treeland-shortcut-manager-v3/CMakeLists.txt |
Builds the v3 fixture. |
tests/protocols/treeland-shortcut-manager-v2/README.md |
Removes obsolete v2 documentation. |
tests/protocols/treeland-shortcut-manager-desktop-v3/treeland-shortcut-manager-desktop-v3.h |
Defines desktop test state. |
tests/protocols/treeland-shortcut-manager-desktop-v3/treeland-shortcut-manager-desktop-v3.c |
Tests desktop v3 behavior. |
tests/protocols/treeland-shortcut-manager-desktop-v3/setup.cpp |
Uses the desktop v3 fixture. |
tests/protocols/treeland-shortcut-manager-desktop-v3/CMakeLists.txt |
Builds the desktop v3 test. |
tests/protocols/INDEX.md |
Updates the protocol test index. |
tests/protocols/CMakeLists.txt |
Registers v3 tests. |
src/seat/helper.h |
Stores the v3 manager. |
src/seat/helper.cpp |
Attaches and initializes the v3 manager. |
src/modules/shortcut/shortcutrunner.cpp |
Maps shortcut actions. |
src/modules/shortcut/shortcutmanager.h |
Defines the v3 manager API. |
src/modules/shortcut/shortcutmanager.cpp |
Implements v3 protocol behavior. |
src/modules/shortcut/shortcutcontroller.h |
Updates v3 action values. |
src/modules/shortcut/shortcutcontroller.cpp |
Implements binding errors and upserts. |
src/modules/shortcut/CMakeLists.txt |
Generates v3 server bindings. |
src/common/shellaction.h |
Declares minimize support. |
src/common/shellaction.cpp |
Executes minimize actions. |
examples/test_shortcut_manager/main.cpp |
Migrates the manager example. |
examples/test_shortcut_manager/CMakeLists.txt |
Generates v3 client bindings. |
examples/test_shortcut_capture/main.cpp |
Migrates the capture example. |
examples/test_shortcut_capture/CMakeLists.txt |
Generates v3 capture bindings. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
b79e960 to
46ce7c0
Compare
fa69b8a to
10a6a7d
Compare
Adapt the shortcut module to treeland-protocols 0.6.0 breaking changes: - Rename manager/capture classes from _v2 to _v3 and restructure the action enum (notify 1→0, 46 entries per the restructured protocol) - Drop the commit mechanism: bind_key/bind_swipe_gesture/bind_hold_gesture take effect immediately, failures reported per-bind via bind_failure; error.invalid_surface moves to 3 and invalid_commit is removed - Fix the bind_key upsert path and keep the per-socket key cache consistent with the controller's (normalized key, action) upsert identity, so renamed binds cannot resurrect stale entries on unbind or session restore - Wire the v3 actions whose execution plumbing exists through mapShortcutAction → ShellActionExecutor: ZoomIn/ZoomOut/ZoomReset, TileTopLeft/TopRight/BottomLeft/BottomRight, MoveWindowToPrevWorkspace/MoveWindowToNextWorkspace; ResizeWindow and TileTop/TileBottom stay ignored per the unsupported-actions-are-never- fatal convention until their semantics land - Fix the shortcut-manager-v3 test README to describe what the capture fixture actually exercises (cleared modifiers, bare F1) Log: WM-442 Influence: shortcut module follows treeland-protocols 0.6.0+
10a6a7d to
8138c14
Compare
| ShowWindowMenu, | ||
| TileLeft, | ||
| TileRight, | ||
| TileTopLeft, |
There was a problem hiding this comment.
这个最好也加上 TileTop 和 TileBottom 作为预留,比如屏幕旋转后的情况,屏幕高比宽大时,可能需要的是上下分屏而不是左右


概述
适配 treeland 的 shortcut 模块到 treeland-protocols 0.6.0 的 breaking 变更,将
treeland-shortcut-manager从 v2 迁移到 v3。变更内容
treeland_shortcut_manager_v2→_v3,treeland_shortcut_capture_v2→_v3commit请求、commit_success/commit_failure事件、error.invalid_commit全部删除bind_failure事件:逐绑定反馈失败,不再回滚同批次其他绑定invalid_surface从 4→3,移除invalid_commitsince属性unbind现从m_shortcuts映射中移除;移除onSessionChanged中的 early return测试
tests/protocols/下 desktop-v3 和基础 v3 两个 fixture,覆盖 capture→captured、即时 bind_key→activated、acquire、bind_key 成功/upsert/name_conflict 等链路examples/test_shortcut_manager和examples/test_shortcut_capture示例代码,移除 commit 逻辑关联
Summary by Sourcery
Migrate Treeland’s shortcut manager integration and test coverage from protocol v2 to v3, adopting immediate per-binding operations and the updated action model.
New Features:
Bug Fixes:
Enhancements:
Build:
Documentation:
Tests:
Chores: