From 9dcebafca20a7ca24686acd602e0e358a73f8c36 Mon Sep 17 00:00:00 2001 From: chenyuanbo Date: Tue, 1 Sep 2026 20:20:17 +0800 Subject: [PATCH] chore: add wake-up auth debounce timer comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the LockWorker constructor, add a descriptive comment to the wake-up authentication timer setup. The comment explains the purpose of the 300ms single-shot timer: on standby resume, the ActiveChanged and PrepareForSleep signals are emitted back-to-back, so the timer guarantees authentication is created only once regardless of which signal triggers first. This is a documentation-only change with no functional modifications to the code. chore: 添加唤醒认证防抖定时器注释 在 LockWorker 构造函数中,为唤醒认证定时器设置添加了描述性注释。注 释说明了 300ms 单次触发定时器的用途:在待机恢复时,ActiveChanged 和 PrepareForSleep 信号会连续发出,因此该定时器确保无论哪个信号先触发,认证 只会创建一次。 这是一次纯文档变更,不涉及代码功能的任何修改。 Influence: 1. No functional changes; verify normal system wake-up and lock functionality remains unaffected 2. Confirm no timing or race condition issues introduced during standby resume PMS: BUG-373405 --- src/dde-lock/lockworker.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dde-lock/lockworker.cpp b/src/dde-lock/lockworker.cpp index 273e53f2..1c034509 100644 --- a/src/dde-lock/lockworker.cpp +++ b/src/dde-lock/lockworker.cpp @@ -56,6 +56,9 @@ LockWorker::LockWorker(SessionBaseModel *const model, QObject *parent) m_resetSessionTimer->setInterval(15000); + // On standby resume, ActiveChanged and PrepareForSleep are reported back to back; + // the 300ms single-shot timer coalesces signal-triggered authentication requests + // that occur within 300ms. m_wakeUpAuthTimer->setSingleShot(true); m_wakeUpAuthTimer->setInterval(300); connect(m_wakeUpAuthTimer, &QTimer::timeout, this, [this](){