Skip to content

fix: replace QProcess with startDetached for calendar DBus call#375

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
robertkill:master
Oct 21, 2025
Merged

fix: replace QProcess with startDetached for calendar DBus call#375
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
robertkill:master

Conversation

@robertkill

@robertkill robertkill commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

Changed the DBus call implementation from using QProcess with waitForFinished to QProcess::startDetached to prevent UI blocking. The previous implementation could cause the dock interface to freeze while waiting for the calendar application response. The new approach launches the DBus call asynchronously without blocking the main thread.

Log: Fixed potential UI freeze when clicking calendar jump button

Influence:

  1. Test clicking the calendar jump button in dock
  2. Verify calendar application opens without dock freezing
  3. Check that multiple rapid clicks don't cause issues
  4. Ensure calendar window raises properly via DBus call

fix: 替换日历DBus调用中的QProcess为startDetached

将DBus调用实现从使用QProcess和waitForFinished改为使用
QProcess::startDetached,以防止UI阻塞。之前的实现在等待日历应用响应时可
能导致dock界面冻结。新方法以异步方式启动DBus调用,不会阻塞主线程。

Log: 修复点击日历跳转按钮时可能出现的UI冻结问题

Influence:

  1. 测试dock中的日历跳转按钮点击功能
  2. 验证日历应用打开时dock不会冻结
  3. 检查多次快速点击不会导致问题
  4. 确保通过DBus调用正确提升日历窗口

PMS: BUG-337385

Summary by Sourcery

Use QProcess::startDetached to asynchronously invoke the calendar DBus call and prevent UI blocking in the dock.

Bug Fixes:

  • Prevent dock interface from freezing when clicking the calendar jump button by eliminating the blocking waitForFinished call.

Enhancements:

  • Replace synchronous QProcess invocation with QProcess::startDetached for the calendar DBus RaiseWindow call.

Changed the DBus call implementation from using QProcess with
waitForFinished to QProcess::startDetached to prevent UI blocking. The
previous implementation could cause the dock interface to freeze while
waiting for the calendar application response. The new approach launches
the DBus call asynchronously without blocking the main thread.

Log: Fixed potential UI freeze when clicking calendar jump button

Influence:
1. Test clicking the calendar jump button in dock
2. Verify calendar application opens without dock freezing
3. Check that multiple rapid clicks don't cause issues
4. Ensure calendar window raises properly via DBus call

fix: 替换日历DBus调用中的QProcess为startDetached

将DBus调用实现从使用QProcess和waitForFinished改为使用
QProcess::startDetached,以防止UI阻塞。之前的实现在等待日历应用响应时可
能导致dock界面冻结。新方法以异步方式启动DBus调用,不会阻塞主线程。

Log: 修复点击日历跳转按钮时可能出现的UI冻结问题

Influence:
1. 测试dock中的日历跳转按钮点击功能
2. 验证日历应用打开时dock不会冻结
3. 检查多次快速点击不会导致问题
4. 确保通过DBus调用正确提升日历窗口

PMS: BUG-337385
@sourcery-ai

sourcery-ai Bot commented Oct 21, 2025

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

Reviewer's Guide

Refactors the calendar DBus launch to use QProcess::startDetached for non-blocking execution, replacing the previous synchronous QProcess setup and wait loop to eliminate UI freeze.

Sequence diagram for asynchronous calendar DBus call on button click

sequenceDiagram
    actor User
    participant JumpCalendarButton
    participant QProcess_startDetached
    participant Calendar_Application
    User->>JumpCalendarButton: Clicks jump button
    JumpCalendarButton->>QProcess_startDetached: Launch dbus-send asynchronously
    QProcess_startDetached->>Calendar_Application: DBus RaiseWindow call
    Calendar_Application-->>User: Calendar window opens (no UI freeze)
Loading

Class diagram for updated JumpCalendarButton DBus call logic

classDiagram
    class JumpCalendarButton {
        +mouseReleaseEvent(QMouseEvent* event)
        - (removed) QProcess process
        - (removed) process.setProgram()
        - (removed) process.setArguments()
        - (removed) process.start()
        - (removed) process.waitForFinished()
        + (added) QProcess::startDetached()
    }
Loading

File-Level Changes

Change Details Files
Switch DBus call from blocking QProcess to asynchronous startDetached
  • Removed QProcess instantiation, start(), and waitForFinished() calls
  • Replaced with QProcess::startDetached invocation
  • Converted arguments to QStringList for startDetached
  • Maintained click signal emission and event propagation
plugins/dde-dock/datetime/calendar/jumpcalendarbutton.cpp

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


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@robertkill

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Oct 21, 2025

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot deepin-bot Bot merged commit fe13d91 into linuxdeepin:master Oct 21, 2025
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