Skip to content

fix: launch default mail client via dde-shortcut-tool mime handler - #187

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
yixinshark:fix/mail-shortcut-launch-mime
Oct 15, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
yixinshark:fix/mail-shortcut-launch-mime

Conversation

@yixinshark

@yixinshark yixinshark commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Mail shortcut no longer runs bare xdg-email via dde-am -c; it now uses dde-shortcut-tool launch mime x-scheme-handler/mailto (serial 0->1), same pattern as audiomedia/music/pictures/video.
  • Root cause: xdg-email is a short-lived wrapper; once it exits, systemd kills the transient cgroup children (default KillMode=control-group), so the real mail client never stays up.

Test plan

  • python3 -m json.tool validates the edited shortcut json.
  • On test machine with default mailto=cmclient.desktop: direct dde-shortcut-tool launch mime x-scheme-handler/mailto opens cmclient and it survives.
  • Via shortcut-equivalent path dde-am -c /usr/bin/dde-shortcut-tool -- launch mime x-scheme-handler/mailto: cmclient stays running; transient unit exits cleanly with no Child cmclient killed TERM. Before the fix, dde-am -c /usr/bin/xdg-email showed exactly that kill in journal and no visible client.

PMS

Pms: BUG-378941

Summary by Sourcery

Bug Fixes:

  • Launch the default mail client through the MIME handler so it remains running when invoked from the mail shortcut.

@sourcery-ai

sourcery-ai Bot commented Oct 12, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The mail shortcut now launches the system default mail client through dde-shortcut-tool's mailto MIME handler, avoiding systemd transient-cgroup cleanup of clients started by xdg-email.

File-Level Changes

Change Details Files
Route the mail shortcut through the MIME handler launcher instead of the short-lived xdg-email wrapper.
  • Replace the mail command with dde-shortcut-tool MIME launch for x-scheme-handler/mailto.
  • Align the invocation and serial behavior with the existing audio, music, pictures, and video shortcuts.
  • Preserve the shortcut configuration as valid JSON.
src/plugin-qt/shortcut/configs/org.deepin.dde.keybinding.shortcut.mail/org.deepin.shortcut.json

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 reviewed your changes and they look great!


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

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 100 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次变更为邮件快捷键配置修复,将 triggerValue 从 xdg-email 改为 dde-shortcut-tool launch mime 方式,与现有 music/pictures/video 快捷键配置模式一致。修改正确解决了 systemd transient service 导致邮件客户端被杀的问题,未引入安全漏洞。

🔍 详细分析

1. 语法逻辑 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: []


2. 代码质量 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: []


3. 代码性能 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: []


4. 代码安全 🔒

评价: 优秀 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: []


💡 改进建议代码示例

// 暂无代码示例

本报告由 AI 代码审查工具自动生成

@deepin-bot

deepin-bot Bot commented Oct 12, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 1.0.45
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #189

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fly602, 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
yixinshark force-pushed the fix/mail-shortcut-launch-mime branch from 71ccc21 to 695e68f Compare October 15, 2026 11:14
The mail shortcut ran `xdg-email` through `dde-am -c`, which starts a
systemd transient service. `xdg-email` is a short-lived wrapper that
spawns the real client via `gio open` and exits immediately, so systemd
kills the remaining cgroup children (KillMode=control-group) and nothing
visible happens.

Change the mail trigger to `dde-shortcut-tool launch mime
x-scheme-handler/mailto` and bump its serial 0->1, aligning with the
existing audiomedia/music/pictures/video shortcuts. The mime handler
resolves the default app via xdg-mime and launches it through the
`dde-am <appId>` Launch path, where the real app is the main process of
its own unit and survives.

邮件快捷键经 `dde-am -c` 执行 `xdg-email`,其为秒退的包装脚本,
拉起真实客户端后主进程即退出,systemd 按默认 control-group 清理
同组残留进程,导致客户端被杀、无任何反应。

将邮件触发改为 `dde-shortcut-tool launch mime x-scheme-handler/mailto`
并将 serial 由 0 递增为 1,与现有的 audiomedia/music/pictures/video
保持一致。mime 通道经 xdg-mime 解析默认应用,再走 `dde-am <appId>`
Launch 路径拉起,真实应用为独立单元主进程,可常驻存活。

Log: launch default mail client via dde-shortcut-tool mime handler
Pms: BUG-378941
Change-Id: Ib9e068286e227d985900058541b6e99abfe6a71d
@yixinshark
yixinshark force-pushed the fix/mail-shortcut-launch-mime branch from 695e68f to 82b0778 Compare October 15, 2026 11:15
@yixinshark

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot
deepin-bot Bot merged commit dfc8bba into linuxdeepin:master Oct 15, 2026
5 of 6 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