Skip to content

refactor: migrate shortcut session actions to compositor-action v1 - #232

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
yixinshark:refactor/shortcut-compositor-action
Nov 20, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
yixinshark:refactor/shortcut-compositor-action

Conversation

@yixinshark

@yixinshark yixinshark commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

The shortcut helper still uses the deprecated dde-shell lockscreen child
interface. Migrate locking, showing the shutdown menu and user switching to
direct treeland_compositor_action_v1 requests, remove the child wrapper and
explicitly destroy the protocol object. Preserve activation waiting and the
request flush used by the short-lived helper, and require TreelandProtocols
0.7.0 in CMake and Debian packaging.

将快捷键工具的锁屏、关机菜单、用户切换操作迁移至 Treeland 新动作协议,
删除旧子对象封装,保留协议激活等待与退出前 flush,并显式销毁协议对象。
同步协议绑定及构建依赖至 TreelandProtocols 0.7.0。锁屏沿用新协议服务端
默认行为,快捷键注册继续使用 shortcut-manager-v3。

Validation / 验证:

  • Built dde-shortcut-tool and plugin-dde-shortcut.
  • Passed shortcut-brightnesspolicy, shortcut-triggeractioncatalog and
    shortcut-waylandshortcuts.
  • A private Wayland connection verified all three actions, immediate flush,
    explicit destruction and failure returns when the protocol is unavailable.
  • Real desktop UI acceptance remains pending.

PMS: TASK-399015

Summary by Sourcery

Migrate shortcut session actions from the deprecated dde-shell interface to Treeland compositor-action v1.

Enhancements:

  • Migrate shortcut lock, shutdown-menu, and user-switch actions to the direct Treeland compositor-action protocol while preserving activation handling and immediate request delivery.
  • Remove the legacy lockscreen child-interface wrapper and explicitly release the compositor-action protocol object.

Build:

  • Require TreelandProtocols 0.7.0 and generate client bindings from the compositor-action protocol.

Replace the deprecated dde-shell lockscreen child interface with direct
treeland_compositor_action_v1 requests for locking, the shutdown menu and
user switching. Keep the helper API, activation timeout and request flush,
and explicitly destroy the protocol object. Update generated bindings and
require TreelandProtocols 0.7.0 in CMake and Debian packaging.

将快捷键工具中已废弃的 dde-shell 锁屏子接口迁移至
treeland_compositor_action_v1,直接发送锁屏、关机菜单和用户切换动作。
保留现有调用接口、协议激活超时及请求 flush,显式销毁协议对象。
同步生成绑定与 CMake、Debian 打包依赖,最低要求 TreelandProtocols 0.7.0。

Validation: helper/plugin builds, three relevant CTest suites and isolated
Wayland action/flush/destruction/unavailable-protocol checks passed.
验证:工具及插件编译、三项相关 CTest 与隔离 Wayland 协议测试通过,
覆盖动作发送、flush、销毁及协议缺失处理。

Log: migrate shortcut session actions to compositor-action v1
PMS: TASK-399015
Change-Id: I55da619c48f335d49c0a70ac80c49419e17f5f3b
@sourcery-ai

sourcery-ai Bot commented Nov 20, 2026

Copy link
Copy Markdown

Reviewer's Guide

API

Update the lockscreen manager declaration to bind directly to compositor-action v1 and expose the three session actions without the legacy child wrapper.

  • src/plugin-qt/shortcut/tools/dde-shortcut-tool/treelandlockscreenwrapper.h L9 (removed lines), L11-23, L35

Uses of the API

Keep the shortcut helper’s existing power-action call sites and update their comments to describe the compositor-action protocol behavior.

  • src/plugin-qt/shortcut/tools/dde-shortcut-tool/main.cpp L36
  • src/plugin-qt/shortcut/tools/dde-shortcut-tool/powercontroller.cpp L262, L298, L404-405
  • src/plugin-qt/shortcut/tools/dde-shortcut-tool/powercontroller.h L67

Implementation

Replace child-object requests with direct compositor actions while preserving activation waiting and flushing, and explicitly destroy the protocol object.

  • src/plugin-qt/shortcut/tools/dde-shortcut-tool/treelandlockscreenwrapper.cpp L25-33, L43-46 (+5 small edits)

Configuration

Require TreelandProtocols 0.7.0, generate compositor-action bindings for the helper, and update its Qt executable declaration.

  • src/plugin-qt/shortcut/tools/dde-shortcut-tool/CMakeLists.txt L11, L18, L52-59

Raise the shortcut plugin’s TreelandProtocols minimum version to 0.7.0.

  • src/plugin-qt/shortcut/CMakeLists.txt L23

Update Debian packaging to require the protocol package version needed by the migrated action protocol.

  • debian/control L41

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/plugin-qt/shortcut/tools/dde-shortcut-tool/CMakeLists.txt" line_range="11" />
<code_context>
 find_package(Dtk6 REQUIRED COMPONENTS Core DConfig Gui)
 find_package(PkgConfig REQUIRED)
-find_package(TreelandProtocols 0.6.0 REQUIRED)
+find_package(TreelandProtocols 0.7.0 REQUIRED)

 pkg_check_modules(XCB REQUIRED xcb xcb-keysyms)
</code_context>
<issue_to_address>
**Documented builds reject stated version**

When a developer follows either document and has TreelandProtocols 0.6.x installed, cMake's `find_package(TreelandProtocols 0.7.0 REQUIRED)` rejects the documented 0.6.0 minimum, so users following either build guide cannot configure with that stated dependency.

Update both documented build prerequisites to TreelandProtocols 0.7.0 or newer.

Also at `src/plugin-qt/shortcut/CMakeLists.txt:23`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: robertkill, yixinshark

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@yixinshark

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Nov 20, 2026

Copy link
Copy Markdown

This pr force merged! (status: behind)

@deepin-bot
deepin-bot Bot merged commit f22b96b into linuxdeepin:master Nov 20, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants