Skip to content

sync: from linuxdeepin/dde-session-shell - #551

Open
deepin-ci-robot wants to merge 1 commit into
masterfrom
sync-pr-100-nosync
Open

deepin-ci-robot wants to merge 1 commit into
masterfrom
sync-pr-100-nosync

Conversation

@deepin-ci-robot

@deepin-ci-robot deepin-ci-robot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Synchronize source files from linuxdeepin/dde-session-shell.

Source-pull-request: linuxdeepin/dde-session-shell#100

Summary by Sourcery

Synchronize session-shell sources and improve lock-screen behavior on X11 connection failures.

Bug Fixes:

  • Ensure the lock screen process exits cleanly when an X11 I/O error occurs.

Enhancements:

  • Synchronize login-gesture rendering dependencies with the upstream session-shell sources.

Chores:

  • Synchronize source files with linuxdeepin/dde-session-shell.

@deepin-ci-robot

Copy link
Copy Markdown
Contributor Author

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deepin-ci-robot

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

@sourcery-ai

sourcery-ai Bot commented Oct 8, 2026

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

Reviewer's Guide

Synchronizes the lock-screen sources with upstream, including a desktop-entry update and an X11 I/O error handler that exits the process when the X connection fails.

Sequence diagram for lock screen X11 failure handling

sequenceDiagram
    participant LockApp as dde-lock
    participant XServer as X11 Display

    LockApp->>XServer: app->exec()
    XServer--xLockApp: X11 I/O failure
    LockApp->>LockApp: x11IOErrorHandler(Display *)
    LockApp->>LockApp: _exit(0)
Loading

File-Level Changes

Change Details Files
Add graceful handling for fatal X11 I/O failures in the lock screen process.
  • Include X11 client APIs.
  • Register an X11 I/O error callback that terminates the process immediately via _exit(0).
  • Install the callback before entering the application event loop.
src/app/dde-lock.cpp
Synchronize the lock desktop entry with the upstream dde-session-shell implementation.
  • Apply the upstream desktop-file metadata/content update.
files/snipe/dde-lock.desktop

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/app/dde-lock.cpp" line_range="36" />
<code_context>

+static int x11IOErrorHandler(Display *)
+{
+    _exit(0);
+}
+
</code_context>
<issue_to_address>
**Lock screen stays closed after X11 recovers**

When the X server drops dde-lock’s connection after the handler is installed and dde-lock.service uses Restart=on-failure, `x11IOErrorHandler` calls `_exit(0)` without logging, so systemd records a clean stop and does not restart dde-lock. After the X server recovers, the locked session has no lock-screen surface until another caller launches it, and operators see no journal diagnostic for the X11 failure.

Log the X11 failure and exit unsuccessfully so systemd can restart dde-lock.
</issue_to_address>

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

Comment thread src/app/dde-lock.cpp

static int x11IOErrorHandler(Display *)
{
_exit(0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · Lock screen stays closed after X11 recovers

When the X server drops dde-lock’s connection after the handler is installed and dde-lock.service uses Restart=on-failure, x11IOErrorHandler calls _exit(0) without logging, so systemd records a clean stop and does not restart dde-lock. After the X server recovers, the locked session has no lock-screen surface until another caller launches it, and operators see no journal diagnostic for the X11 failure.

Log the X11 failure and exit unsuccessfully so systemd can restart dde-lock.

Prompt for AI agents
In `src/app/dde-lock.cpp` at line 36:

**Lock screen stays closed after X11 recovers**

When the X server drops dde-lock’s connection after the handler is installed and dde-lock.service uses Restart=on-failure, `x11IOErrorHandler` calls `_exit(0)` without logging, so systemd records a clean stop and does not restart dde-lock. After the X server recovers, the locked session has no lock-screen surface until another caller launches it, and operators see no journal diagnostic for the X11 failure.

Log the X11 failure and exit unsuccessfully so systemd can restart dde-lock.

Synchronize source files from linuxdeepin/dde-session-shell.

Source-pull-request: linuxdeepin/dde-session-shell#100
@deepin-ci-robot

Copy link
Copy Markdown
Contributor Author

deepin pr auto review

🤖 AI 代码审查报告

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

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 总体评分 98 分,大于 70 分通过阈值,代码质量符合要求。本次变更同步自上游仓库,包含 .desktop 文件桌面环境扩展、QPainterPath 缺失头文件修复及 X11 IO 错误处理程序注册,代码实现与同步目的一致,未发现安全漏洞。

🔍 详细分析

1. 语法逻辑 ✅

评价: 优秀 ✅ 通过

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

建议: 语法正确,逻辑清晰,无需修改


2. 代码质量 ✅

评价: 优秀 ✅ 通过

潜在问题:

  1. src/app/dde-lock.cpp:32 - x11IOErrorHandler 函数缺少注释说明其目的和 _exit(0) 的使用原因

建议: 建议为 x11IOErrorHandler 函数添加注释,说明在 X11 IO 错误(如显示服务器断开连接)时调用 _exit(0) 进行安全退出的原因,以及为何使用 _exit 而非 exit


3. 代码性能 ✅

评价: 优秀 ✅ 通过

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

建议: 性能良好,无需优化


4. 代码安全 🔒

评价: 优秀 ✅ 通过

🔐 发现 0 个安全漏洞

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

建议: 安全合规,无需加固


💡 改进建议代码示例

// X11 IO 错误处理函数
// 当 X11 连接发生致命 IO 错误(如显示服务器崩溃/断开)时被调用
// 使用 _exit(0) 而非 exit() 以避免调用 atexit 处理器和静态析构函数,
// 防止在异常状态下执行清理操作导致二次崩溃
static int x11IOErrorHandler(Display *)
{
    _exit(0);
}

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

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.

1 participant