Skip to content

fix: move fallback timer stop to after page show completes#3303

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
caixr23:master
Jun 17, 2026
Merged

fix: move fallback timer stop to after page show completes#3303
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
caixr23:master

Conversation

@caixr23

@caixr23 caixr23 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor
  1. Remove m_showFallbackTimer->stop() from waitShowPage() and doShowPage() entry, move it to doShowPage() after all return statements so the timer is only stopped when the page has successfully been shown.
  2. This prevents the fallback mechanism from being interrupted when the user quickly clicks the control center icon after logout, fixing the issue where the control center fails to open.

Log: Fixed control center failing to open after quick click post-logout.

Influence:

  1. Logout and quickly click the control center icon on the taskbar repeatedly to verify it opens successfully each time.
  2. Test the same scenario on both X11 and Wayland sessions.

PMS: BUG-366579

fix: 将 fallback 定时器停止移至页面展示完成后

  1. 从 waitShowPage() 和 doShowPage() 开头移除 m_showFallbackTimer->stop(),将其移至 doShowPage() 所有 return 语句之后,确保只有在页面成功展示后才停止定时器。
  2. 这防止了在快速点击任务栏控制中心图标后,fallback 机制被提前打断, 解决了注销后控制中心打开失败的问题。

Log: 修复注销后快速点击控制中心图标打开失败的问题。

Influence:

  1. 注销后快速连续点击任务栏上的控制中心图标,验证每次都能 正常打开。
  2. 分别在 X11 和 Wayland 会话下测试上述场景。

Summary by Sourcery

Bug Fixes:

  • Fix control center failing to open when the control center icon is clicked quickly after logout by deferring fallback timer shutdown.

@caixr23 caixr23 requested a review from 18202781743 June 17, 2026 07:11
1. Remove m_showFallbackTimer->stop() from waitShowPage() and
   doShowPage() entry, move it to doShowPage() after all return
   statements so the timer is only stopped when the page has
   successfully been shown.
2. This prevents the fallback mechanism from being interrupted when
   the user quickly clicks the control center icon after logout,
   fixing the issue where the control center fails to open.

Log: Fixed control center failing to open after quick click post-logout.

Influence:
1. Logout and quickly click the control center icon on the taskbar
   repeatedly to verify it opens successfully each time.
2. Test the same scenario on both X11 and Wayland sessions.

PMS: BUG-366579

fix: 将 fallback 定时器停止移至页面展示完成后

1. 从 waitShowPage() 和 doShowPage() 开头移除
   m_showFallbackTimer->stop(),将其移至 doShowPage() 所有 return
   语句之后,确保只有在页面成功展示后才停止定时器。
2. 这防止了在快速点击任务栏控制中心图标后,fallback 机制被提前打断,
   解决了注销后控制中心打开失败的问题。

Log: 修复注销后快速点击控制中心图标打开失败的问题。

Influence:
1. 注销后快速连续点击任务栏上的控制中心图标,验证每次都能
   正常打开。
2. 分别在 X11 和 Wayland 会话下测试上述场景。
@sourcery-ai

sourcery-ai Bot commented Jun 17, 2026

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

Reviewer's Guide

Adjusts the control center page display flow so the fallback timer is only stopped after a page has successfully finished showing, preventing premature cancellation of the fallback mechanism when users rapidly open the control center after logout.

Sequence diagram for updated control center page show and fallback timer

sequenceDiagram
    actor User
    participant TaskbarIcon
    participant DccManager
    participant m_showFallbackTimer
    participant Page

    User->>TaskbarIcon: click()
    TaskbarIcon->>DccManager: waitShowPage(url, message)
    DccManager->>DccManager: clearShowParam()
    Note over DccManager,m_showFallbackTimer: m_showFallbackTimer is NOT stopped here anymore

    DccManager->>DccManager: doShowPage(obj, cmd)
    DccManager->>Page: [show page]
    Page-->>DccManager: [page shown successfully]

    DccManager->>m_showFallbackTimer: stop()
    Note over DccManager,m_showFallbackTimer: Fallback timer stopped only after successful show
Loading

File-Level Changes

Change Details Files
Delay stopping the show fallback timer until after a page has fully finished showing.
  • Removed the call to stop the fallback timer at the start of waitShowPage() so the timer continues running while the page show process is in progress.
  • Removed the call to stop the fallback timer at the start of doShowPage(), ensuring the timer is not cleared before all early-return conditions are evaluated.
  • Added a single call to stop the fallback timer at the end of doShowPage(), after all signals and updates have been emitted, so the timer is only stopped on successful completion of the show-page flow.
src/dde-control-center/dccmanager.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 - 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

deepin pr auto review

★ 总体评分:100分

■ 【总体评价】

代码精准修复了回退定时器被提前中断导致页面显示异常的问题
逻辑完全正确且无任何副作用,得满分

■ 【详细分析】

  • 1.语法逻辑(完全正确)✓

修改将 m_showFallbackTimer->stop()waitShowPagedoShowPage 的入口处移除,并放置在 doShowPage 所有页面跳转、数据加载和信号触发逻辑完成之后。这保证了在繁重的渲染或加载过程中发生异常时,兜底定时器能正常触发回退逻辑,修复了原有逻辑缺陷。
建议:保持当前逻辑,无需额外修改

  • 2.代码质量(良好)✓

代码改动极简且目的明确,去除了可能导致状态混乱的提前停止操作,使得定时器的生命周期管理更加清晰,符合 Qt 事件循环和状态机的编码规范。
建议:可考虑为 m_showFallbackTimer 的启动和停止逻辑添加简短注释,说明其作为兜底机制的作用

  • 3.代码性能(无性能问题)✓

仅仅调整了定时器停止的时机,未引入任何额外的计算开销、系统调用或资源消耗,对性能无任何负面影响。
建议:无需优化

  • 4.代码安全(存在0个安全漏洞)✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次修改仅涉及内部定时器状态控制,不涉及外部输入处理、内存越界、权限变更或敏感数据泄露,代码安全可靠。
建议:维持现有安全编码标准

■ 【改进建议代码示例】

// 当前代码逻辑已经非常完善,以下为增强可读性的微调示例(添加注释)
void DccManager::doShowPage(QPointer<DccObject> obj, const QString &cmd)
{
    if (m_plugins->isDeleting() || !obj) {
        return;
    }
    qCInfo(dccLog) << "ShowPage:" << obj << "have cmd:" << !cmd.isEmpty();
    // ... 中间执行了大量页面跳转、数据加载和信号触发逻辑
    
    if (triggeredObjectsUpdated)
        Q_EMIT triggeredObjectsChanged(m_triggeredObjects);

    // 页面展示及信号发送均已完成,此时停止兜底定时器
    m_showFallbackTimer->stop();
}

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@caixr23

caixr23 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot deepin-bot Bot merged commit 9118f5c into linuxdeepin:master Jun 17, 2026
17 of 19 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